Documentation
¶
Index ¶
- func NewDuration(d time.Duration) *durationpb.Duration
- func NewTimestamp(ts *time.Time) (*timestamppb.Timestamp, error)
- func ParseDuration(duration *durationpb.Duration) (time.Duration, error)
- func ParseTimestamp(timestamp *timestamppb.Timestamp, location ...*time.Location) (*time.Time, error)
- func ProtoMessage2JSON(message proto.Message) (string, error)
- func ProtoMessage2Map(message proto.Message) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDuration ¶
func NewDuration(d time.Duration) *durationpb.Duration
NewDuration create protobuf duration by time.Duration
func NewTimestamp ¶
func NewTimestamp(ts *time.Time) (*timestamppb.Timestamp, error)
NewTimestamp create protobuf timestamp by time.Time
func ParseDuration ¶
func ParseDuration(duration *durationpb.Duration) (time.Duration, error)
ParseDuration get time.Duration from protobuf duration
func ParseTimestamp ¶
func ParseTimestamp(timestamp *timestamppb.Timestamp, location ...*time.Location) (*time.Time, error)
ParseTimestamp get time.Time from protobuf timestamp
func ProtoMessage2JSON ¶
ProtoMessage2JSON marshal protobuf message to json string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.