arpcdata

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 StructOptional

func StructOptional(src map[string]interface{}) (*structpb.Struct, error)

func StructOptionalProto

func StructOptionalProto(src *structpb.Struct) map[string]interface{}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL