// RemoveSource removes a reader from the Mux.
555568
func (m *Mux) RemoveSource(source io.Reader) {
	m.m.Lock()
	if m.closed {
		panic("mux: already closed")
	}
	if _, ok := m.readers[source]; !ok {
		panic("mux: the io.Reader is already removed")
	}
	delete(m.readers, source)
	m.m.Unlock()
}
1064216
func readSource(filename string, src interface{}) ([]byte, error) {
	if src == nil {
		return ioutil.ReadFile(filename)
	}
	switch s := src.(type) {
	case string:
		return []byte(s), nil
	}
	return nil, errors.New("invalid source type")
}
688586
func (s *BaseObservableResourceSource) RemoveResourceVersionObserver(observer ResourceVersionObserver) {
	s.locker.Lock()
	defer s.locker.Unlock()

	delete(s.observers, observer)
}
1149751
func (m *Registry) GetSource(sourceType string) (Source, error) {
	return m.getDepth(0, sourceType)
}
1089083
func RemoveResourcePool(conn client.Connection, poolid string) error {
	pth := path.Join("/pools", poolid)

	logger := plog.WithFields(log.Fields{
		"poolid": poolid,
		"zkpath": pth,
	})

	if err := conn.Delete(pth); err != nil {

		logger.WithError(err).Debug("Could not delete resource pool entry from zookeeper")
		return err
	}

	logger.Debug("Deleted resource pool entry from zookeeper")
	return nil
}
1202565
func (c *Client) DeleteResource(providerID, resourceID string) (*ct.Resource, error) {
	res := &ct.Resource{}
	err := c.Delete(fmt.Sprintf("/providers/%s/resources/%s", providerID, resourceID), res)
	return res, err
}
379240
func (s *Service) DeleteSource(ctx context.Context, id platform.ID) error {
	if _, err := s.FindSourceByID(ctx, id); err != nil {
		return &platform.Error{
			Err: err,
			Op:  OpPrefix + platform.OpDeleteSource,
		}
	}
	s.sourceKV.Delete(id.String())
	return nil
}
478658
func (b *UpdateBuilder) RemoveFunc(column string, fn *Func) *UpdateBuilder {
	return b.removeValue(column, fn)
}
276574
func (s *CacheNodeTypeSpecificParameter) SetSource(v string) *CacheNodeTypeSpecificParameter {
	s.Source = &v
	return s
}
817412
func (_m *FacadeInterface) RemoveResourcePool(ctx datastore.Context, id string) error {
	ret := _m.Called(ctx, id)

	var r0 error
	if rf, ok := ret.Get(0).(func(datastore.Context, string) error); ok {
		r0 = rf(ctx, id)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
644322
func (wr *Wrangler) SourceShardDelete(ctx context.Context, keyspace, shard string, uid uint32) (err error) {
	// lock the keyspace
	ctx, unlock, lockErr := wr.ts.LockKeyspace(ctx, keyspace, fmt.Sprintf("SourceShardDelete(%v)", uid))
	if lockErr != nil {
		return lockErr
	}
	defer unlock(&err)

	// remove the source shard
	_, err = wr.ts.UpdateShardFields(ctx, keyspace, shard, func(si *topo.ShardInfo) error {
		var newSourceShards []*topodatapb.Shard_SourceShard
		for _, ss := range si.SourceShards {
			if ss.Uid != uid {
				newSourceShards = append(newSourceShards, ss)
			}
		}
		if len(newSourceShards) == len(si.SourceShards) {
			return fmt.Errorf("no SourceShard with uid %v", uid)
		}
		si.SourceShards = newSourceShards
		return nil
	})
	return err
}
278062
func BuildSource(s string) *Source {
	var result []string
	var lineBuf bytes.Buffer
	for _, runeValue := range s {
		lineBuf.WriteRune(runeValue)
		if runeValue == '\n' {
			result = append(result, lineBuf.String())
			lineBuf.Reset()
		}
	}
	rest := lineBuf.String()
	// Stuff after last end-of-line (EOF or some more code)
	result = append(result, rest+"\n")
	return &Source{result}
}
655429
func (s *Service) RemoveAnnotation(w http.ResponseWriter, r *http.Request) {
	id, err := paramID("id", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	annoID, err := paramStr("aid", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	ctx := r.Context()
	src, err := s.Store.Sources(ctx).Get(ctx, id)
	if err != nil {
		notFound(w, id, s.Logger)
		return
	}

	ts, err := s.TimeSeries(src)
	if err != nil {
		msg := fmt.Sprintf("unable to connect to source %d: %v", id, err)
		Error(w, http.StatusBadRequest, msg, s.Logger)
		return
	}

	if err = ts.Connect(ctx, &src); err != nil {
		msg := fmt.Sprintf("unable to connect to source %d: %v", id, err)
		Error(w, http.StatusBadRequest, msg, s.Logger)
		return
	}

	store := influx.NewAnnotationStore(ts)
	if err = store.Delete(ctx, annoID); err != nil {
		if err == chronograf.ErrUpstreamTimeout {
			msg := "Timeout waiting for  response"
			Error(w, http.StatusRequestTimeout, msg, s.Logger)
			return
		}
		Error(w, http.StatusBadRequest, err.Error(), s.Logger)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
489854
func (s *SendRawEmailInput) SetSource(v string) *SendRawEmailInput {
	s.Source = &v
	return s
}
948835
func (m *Manager) AddSource(srcs ...Source) {
	m.srcs = append(m.srcs, srcs...)
}
722859
func (a *api) RemoveResourcePool(id string) error {
	client, err := a.connectMaster()
	if err != nil {
		return err
	}

	return client.RemoveResourcePool(id)
}
725801
func (s *GetPlanInput) SetSource(v *CatalogEntry) *GetPlanInput {
	s.Source = v
	return s
}