MCPcopy Create free account
hub / github.com/aws/smithy-go / Encode

Method Encode

document/cbor/encode.go:44–51  ·  view source on GitHub ↗

Encode returns the CBOR encoding of v.

(v interface{})

Source from the content-addressed store, hash-verified

42
43// Encode returns the CBOR encoding of v.
44func (e *encoder) Encode(v interface{}) ([]byte, error) {
45 cv, err := e.encode(reflect.ValueOf(v), serde.Tag{})
46 if err != nil {
47 return nil, err
48 }
49
50 return cbor.Encode(cv), nil
51}
52
53func (e *encoder) encode(rv reflect.Value, tag serde.Tag) (cbor.Value, error) {
54 if serde.IsZeroValue(rv) {

Callers 8

TestEncode_KitchenSinkFunction · 0.95
addSignatureToQueryMethod · 0.45
SignRequestMethod · 0.45
computeMD5ChecksumFunction · 0.45
formatFunction · 0.45

Calls 2

encodeMethod · 0.95
EncodeFunction · 0.92

Tested by 2

TestEncode_KitchenSinkFunction · 0.76