open-consul/proto/pbutil/pbutil.go
2022-03-16 12:12:29 -04:00

24 lines
457 B
Go

package pbutil
import (
"time"
"github.com/gogo/protobuf/types"
)
func DurationToProto(d time.Duration) *types.Duration {
return types.DurationProto(d)
}
func DurationFromProto(d *types.Duration) (time.Duration, error) {
return types.DurationFromProto(d)
}
func TimeFromProto(s *types.Timestamp) (time.Time, error) {
return types.TimestampFromProto(s)
}
func TimeToProto(s time.Time) (*types.Timestamp, error) {
return types.TimestampProto(s)
}