Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MarshalOptions ¶
type MarshalOptions struct { // EmitFirestoreSensibleDefaults specifies whether to emit default values // for fields which would otherwise be omitted. This is useful for ensuring that // the firestore database queries can be used to filter on the fields because // firestore does not support checking for the absence of a field. // The fields affected are as follows: // ╔═══════╤════════════════════════════════════════╗ // ║ JSON │ Protobuf field ║ // ╠═══════╪════════════════════════════════════════╣ // ║ false │ non-optional scalar boolean fields ║ // ║ 0 │ non-optional scalar numeric fields ║ // ║ "" │ non-optional scalar string/byte fields ║ // ║ {} │ non-optional messages within one ofs ║ // ╚═══════╧════════════════════════════════════════╝ // // The reason for the non-optional restriction is that optional fields // are not guaranteed to be present in the proto message, and therefore // the firestore query would not be able to filter on the field. // // The reason for the oneof non-optional messages being empty map in json // is that when deserializing from firestore, the oneof field needs to know // which field to populate, and if the field is not present in the json, // then it will just be nil. EmitFirestoreSensibleDefaults bool // Resolver is used for looking up types when expanding google.protobuf.Any // messages. If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { protoregistry.ExtensionTypeResolver protoregistry.MessageTypeResolver } }
Click to show internal directories.
Click to hide internal directories.