MCPcopy Create free account
hub / github.com/google/go-cloud / EncodeMap

Method EncodeMap

docstore/driver/codec.go:88–88  ·  view source on GitHub ↗

EncodeMap is called when a map is encountered. Its argument is the number of fields in the map. The encoding algorithm will call the returned Encoder that many times to encode the successive values of the map. After each such call, MapKey will be called with the key of the element just encoded. For

(n int)

Source from the content-addressed store, hash-verified

86 // fields of the struct. For struct{A, B int}{1, 2}, if EncodeStruct returns
87 // false, the same sequence of calls as above will occur.
88 EncodeMap(n int) Encoder
89 MapKey(string)
90
91 // If the encoder wants to encode a value in a special way it should do so here

Callers 2

encodeMapFunction · 0.65
encodeStructWithFieldsFunction · 0.65

Implementers 5

encoderdocstore/memdocstore/codec.go
encoderdocstore/awsdynamodb/v2/codec.go
encoderdocstore/gcpfirestore/codec.go
testEncoderdocstore/driver/codec_test.go
encoderdocstore/mongodocstore/codec.go

Calls

no outgoing calls

Tested by

no test coverage detected