Encode a Go value into a Firestore proto document.
(x any)
| 111 | |
| 112 | // Encode a Go value into a Firestore proto document. |
| 113 | func (c *nativeCodec) Encode(x any) (*pb.Document, error) { |
| 114 | _, err := c.client.Collection("C").Doc("D").Create(context.Background(), x) |
| 115 | if err != nil { |
| 116 | return nil, err |
| 117 | } |
| 118 | return c.doc, nil |
| 119 | } |
| 120 | |
| 121 | // Decode value, which must be a *pb.Document, into dest. |
| 122 | func (c *nativeCodec) Decode(value *pb.Document, dest any) error { |
no test coverage detected