// addCodec adds registers injector and extractor for given propagation format if not already defined.
169690
func (t *Tracer) addCodec(format interface{}, injector Injector, extractor Extractor) {
	if _, ok := t.injectors[format]; !ok {
		t.injectors[format] = injector
	}
	if _, ok := t.extractors[format]; !ok {
		t.extractors[format] = extractor
	}
}
307346
func (c *Capabilities) addExtension(r io.Reader) error {
	var buf bytes.Buffer
	encoder := base64.NewEncoder(base64.StdEncoding, &buf)
	if _, err := io.Copy(encoder, bufio.NewReader(r)); err != nil {
		return err
	}
	encoder.Close()
	c.Extensions = append(c.Extensions, buf.String())
	return nil
}
765959
func NewDecoder() *Decoder {

	d := &Decoder{
		tagName:      "form",
		mode:         ModeImplicit,
		structCache:  newStructCacheMap(),
		maxArraySize: 10000,
	}

	d.dataPool = &sync.Pool{New: func() interface{} {
		return &decoder{
			d:         d,
			namespace: make([]byte, 0, 64),
		}
	}}

	return d
}
163467
func NewDecoder(r io.ReadCloser, codec runtime.Codec) *Decoder {
	return &Decoder{
		r:       r,
		decoder: json.NewDecoder(r),
		codec:   codec,
	}
}
591815
func (s *Staert) AddSource(src Source) {
	s.sources = append(s.sources, src)
}
846011
func (c *Composer) AddExpr(key, operator string, value interface{}) {
	if value == nil {
		return
	}

	switch v := value.(type) {
	case struct{}:
		c.addExpr(key, operator, value)
	case []byte:
		if v != nil {
			c.addExpr(key, operator, value)
		}
	case string:
		c.addExpr(key, operator, value)
	case int64:
		c.addExpr(key, operator, value)
	case int32:
		c.addExpr(key, operator, value)
	case int16:
		c.addExpr(key, operator, value)
	case int8:
		c.addExpr(key, operator, value)
	case int:
		c.addExpr(key, operator, value)
	case float32:
		c.addExpr(key, operator, value)
	case float64:
		c.addExpr(key, operator, value)
	case uint64:
		c.addExpr(key, operator, value)
	case uint32:
		c.addExpr(key, operator, value)
	case uint16:
		c.addExpr(key, operator, value)
	case uint8:
		c.addExpr(key, operator, value)
	case uint:
		c.addExpr(key, operator, value)
	case complex64:
		c.addExpr(key, operator, value)
	case complex128:
		c.addExpr(key, operator, value)
	case bool:
		c.addExpr(key, operator, value)
	case []string:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []int64:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []int32:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []int16:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []int8:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []int:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []float32:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []float64:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []uint64:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []uint32:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []uint16:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []uint:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []complex64:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []complex128:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case []bool:
		for _, vv := range v {
			c.addExpr(key, operator, vv)
		}
	case *time.Time:
		if v != nil && !v.IsZero() {
			c.addExpr(key, operator, value)
		}
	case time.Time:
		if !v.IsZero() {
			c.addExpr(key, operator, value)
		}
	case Appearer:
		if v.Appear() {
			c.addExpr(key, operator, value)
		}
	case *sql.NullBool:
		if v != nil && v.Valid {
			c.addExpr(key, operator, value)
		}
	case *sql.NullString:
		if v != nil && v.Valid {
			c.addExpr(key, operator, value)
		}
	case *sql.NullInt64:
		if v != nil && v.Valid {
			c.addExpr(key, operator, value)
		}
	case *sql.NullFloat64:
		if v != nil && v.Valid {
			c.addExpr(key, operator, value)
		}
	default:
		vo := reflect.ValueOf(v)
		switch vo.Kind() {
		case reflect.Slice:
			if !vo.IsNil() {
				c.addExpr(key, operator, value)
			}
		default:
			c.addExpr(key, operator, value)
		}
	}
}
63432
func (mp *MockPeerCCSupport) AddCC(name string, recv chan *pb.ChaincodeMessage, send chan *pb.ChaincodeMessage) (*MockCCComm, error) {
	if mp.ccStream[name] != nil {
		return nil, fmt.Errorf("CC %s already added", name)
	}
	mcc := &MockCCComm{name: name, recvStream: recv, sendStream: send}
	mp.ccStream[name] = mcc
	return mcc, nil
}
325947
func NewDecoder(opts ...func(*Decoder)) *Decoder {
	d := &Decoder{
		MarshalOptions: MarshalOptions{
			SupportJSONTags: true,
		},
	}
	for _, o := range opts {
		o(d)
	}

	return d
}
382321
func NewJSONCodec(conn io.ReadWriteCloser) rpc2.Codec {
	return &jsonCodec{
		dec:     json.NewDecoder(conn),
		enc:     json.NewEncoder(conn),
		c:       conn,
		pending: make(map[uint64]*json.RawMessage),
	}
}
153024
func (info *SegmentInfo) SetCodec(codec interface{}) {
	assert(info.codec == nil)
	assert2(codec != nil, "codecs must not be nil")
	info.codec = codec
}
1250617
func NewDecoder(s encoding.Source) encoding.Decoder {
	r := s()
	dec := framing.NewDecoder(r, json.Unmarshal)
	return encoding.DecoderFunc(func(u encoding.Unmarshaler) error { return dec.Decode(u) })
}
1262857
func NewDecoder(s encoding.Source) encoding.Decoder {
	r := s()
	var (
		uf  = func(b []byte, m interface{}) error { return proto.Unmarshal(b, m.(proto.Message)) }
		dec = framing.NewDecoder(r, uf)
	)
	return encoding.DecoderFunc(func(u encoding.Unmarshaler) error { return dec.Decode(u) })
}
303949
func NewDecoder(decoder streaming.Decoder, embeddedDecoder runtime.Decoder) *Decoder {
	return &Decoder{
		decoder:         decoder,
		embeddedDecoder: embeddedDecoder,
	}
}
701143
func (cm *CodecMap) RegisterNetCodec(a *NetCodec) {
	cm.lk.Lock()
	defer cm.lk.Unlock()
	for _, n := range a.NetAddrNetworks {
		cm.addrParsers[n] = a.ParseNetAddr
	}

	cm.maddrParsers[a.ProtocolName] = a.ConvertMultiaddr
}
102473
func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
	return f.d.h.getExt(rtid)
}
880330
func (enc *Encoder) AddUint8Key(key string, v uint8) {
	enc.Uint64Key(key, uint64(v))
}
409889
func NewConsumerCodec(f func(io.ReadWriteCloser) rpc.ClientCodec) *rpc.Client {
	return rpc.NewClientWithCodec(f(rwCloser{os.Stdin, os.Stdout}))
}