Documentation ¶
Index ¶
- func JSON2ProtoMessage(raw []byte, message proto.Message) error
- 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) (json.RawMessage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSON2ProtoMessage ¶ added in v1.3.0
JSON2ProtoMessage unmarshal json to protobuf message
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 ¶
func ProtoMessage2JSON(message proto.Message) (json.RawMessage, error)
ProtoMessage2JSON marshal protobuf message to json message
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.