// EncodeTLSToObject returns a JSON-marshallable description of a TLS connection
776148
func EncodeTLSToObject(t *tls.ConnectionState) interface{} {
	version := lookup(tlsVersions, t.Version)
	cipher := lookup(cipherSuites, t.CipherSuite)
	return &TLSDescription{
		version.Slug,
		cipher.Slug,
	}
}
900715
func (m _Map_String_String_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	for k, v := range m {
		enc.AddString((string)(k), v)
	}
	return err
}
939169
func (tx *Transaction) EncodeRLP(w io.Writer) error {
	return rlp.Encode(w, &tx.data)
}
1097213
func (in *TLS) DeepCopy() *TLS {
	if in == nil {
		return nil
	}
	out := new(TLS)
	in.DeepCopyInto(out)
	return out
}
471230
func (b *Block) EncodeRLP(w io.Writer) error {
	return rlp.Encode(w, extblock{
		Header: b.header,
		Txs:    b.transactions,
		Uncles: b.uncles,
	})
}
1259101
func EncodeBitsToString(src []byte, bits int) string {
	dst := make([]byte, EncodedLen(len(src)))
	n := EncodeBits(dst, src, bits)
	return string(dst[:n])
}
306851
func (v *Xtruct3) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.StringThing != nil {
		enc.AddString("string_thing", *v.StringThing)
	}
	if v.Changed != nil {
		enc.AddInt32("changed", *v.Changed)
	}
	if v.I32Thing != nil {
		enc.AddInt32("i32_thing", *v.I32Thing)
	}
	if v.I64Thing != nil {
		enc.AddInt64("i64_thing", *v.I64Thing)
	}
	return err
}
291211
func EncodeOptHTMLEscape(doEscape bool) EncodeOpt {
	return func(e *json.Encoder) {
		e.SetEscapeHTML(doEscape)
	}
}
754221
func EncodeHTTPAuthorizeTokenResponse(accessTokenHeader, payloadHeader, sessionHeader string) httptransport.EncodeResponseFunc {
	return func(ctx context.Context, w http.ResponseWriter, response interface{}) error {
		res := response.(authorizeTokenResponse)
		if res.Err != nil {
			return businessErrorEncoder(ctx, res.Err, w)
		}

		w.Header().Add(accessTokenHeader, res.Token)
		if res.Session != nil {
			if res.Session.Payload != nil {
				w.Header().Add(payloadHeader, base64.StdEncoding.EncodeToString(res.Session.Payload))
			}
			res.Session.Policies = nil
			res.Session.Payload = nil
			s, _ := json.Marshal(res.Session)
			w.Header().Add(sessionHeader, base64.StdEncoding.EncodeToString(s))
		}

		defer kitty.TraceStatusAndFinish(ctx, w.Header(), 204)
		w.WriteHeader(204)
		return nil
	}
}
691122
func EncodeObjectManagedFields(obj runtime.Object, fields fieldpath.ManagedFields) error {
	accessor, err := meta.Accessor(obj)
	if err != nil {
		panic(fmt.Sprintf("couldn't get accessor: %v", err))
	}

	managed, err := encodeManagedFields(fields)
	if err != nil {
		return fmt.Errorf("failed to convert back managed fields to API: %v", err)
	}
	accessor.SetManagedFields(managed)

	return nil
}
447004
func EncodeX509KeyPairString(cert tls.Certificate) (string, string) {
	certpem, keypem := EncodeX509KeyPair(cert)
	return string(certpem), string(keypem)
}
38152
func (v *ResourceDoesNotExist) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("key", v.Key)
	if v.Message != nil {
		enc.AddString("message", *v.Message)
	}
	return err
}
858170
func (dsl *DestSmeList) SerializeTo(w io.Writer) error {
	_, err := w.Write(dsl.Bytes())
	return err
}
1227659
func (v *OrderedValues) Encode() string {
	buf := &bytes.Buffer{}
	v.EncodeTo(buf)
	return buf.String()
}
1002323
func (t *Tree) Encode(o plumbing.EncodedObject) (err error) {
	o.SetType(plumbing.TreeObject)
	w, err := o.Writer()
	if err != nil {
		return err
	}

	defer ioutil.CheckClose(w, &err)
	for _, entry := range t.Entries {
		if _, err = fmt.Fprintf(w, "%o %s", entry.Mode, entry.Name); err != nil {
			return err
		}

		if _, err = w.Write([]byte{0x00}); err != nil {
			return err
		}

		if _, err = w.Write([]byte(entry.Hash[:])); err != nil {
			return err
		}
	}

	return err
}
782489
func (b TCP) Encode(t *TCPFields) {
	b.encodeSubset(t.SeqNum, t.AckNum, t.Flags, t.WindowSize)
	binary.BigEndian.PutUint16(b[TCPSrcPortOffset:], t.SrcPort)
	binary.BigEndian.PutUint16(b[TCPDstPortOffset:], t.DstPort)
	b[TCPDataOffset] = (t.DataOffset / 4) << 4
	binary.BigEndian.PutUint16(b[TCPChecksumOffset:], t.Checksum)
	binary.BigEndian.PutUint16(b[TCPUrgentPtrOffset:], t.UrgentPointer)
}
1285852
func EncodeKeys(anyObject ...interface{}) ([]byte, error) {
	var buf bytes.Buffer
	en := msgp.NewWriter(&buf)
	for _, obj := range anyObject {
		if err := en.WriteIntf(obj); err != nil {
			return nil, fmt.Errorf("Failed to encode key: %v", err)
		}
	}
	return buf.Bytes(), nil
}