Documentation ¶
Index ¶
- func DurationOptional(src *time.Duration) *durationpb.Duration
- func DurationOptionalProto(duration *durationpb.Duration) *time.Duration
- func StructOptional(src map[string]interface{}) (*structpb.Struct, error)
- func StructOptionalProto(src *structpb.Struct) map[string]interface{}
- func TimestampOptional(src *time.Time) *timestamppb.Timestamp
- func TimestampOptionalProto(timestamp *timestamppb.Timestamp) *time.Time
- type ProtoConverter
- type ProtoMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationOptional ¶
func DurationOptional(src *time.Duration) *durationpb.Duration
func DurationOptionalProto ¶
func DurationOptionalProto(duration *durationpb.Duration) *time.Duration
func StructOptionalProto ¶
func TimestampOptional ¶
func TimestampOptional(src *time.Time) *timestamppb.Timestamp
func TimestampOptionalProto ¶
func TimestampOptionalProto(timestamp *timestamppb.Timestamp) *time.Time
Types ¶
type ProtoConverter ¶
type ProtoConverter[Proto comparable, Entity comparable] interface { ToProto(src Entity) Proto FromProto(src Proto) Entity }
func NewProtoConverter ¶
func NewProtoConverter[Proto comparable, Entity comparable]( mapper ProtoMapper[Proto, Entity], protoDefault Proto, entityDefault Entity, ) ProtoConverter[Proto, Entity]
type ProtoMapper ¶
type ProtoMapper[Proto comparable, Entity comparable] map[Proto]Entity
Click to show internal directories.
Click to hide internal directories.