X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fvpe_types%2Fvpe_types.ba.go;h=779cbdb0d9ecd1adf8d6f0d73f0e70afe37d21f6;hb=0a0c03d459547aa9004cbbc1ed9a358d831adf03;hp=f14d5ab3fd6ce496467b094cabb1f3e496a72ba1;hpb=debc52dea8a81417bb08ca5bb934c7876b6d65e0;p=govpp.git diff --git a/binapi/vpe_types/vpe_types.ba.go b/binapi/vpe_types/vpe_types.ba.go index f14d5ab..779cbdb 100644 --- a/binapi/vpe_types/vpe_types.ba.go +++ b/binapi/vpe_types/vpe_types.ba.go @@ -1,6 +1,6 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.3.5-56-gc0da1f2-dirty +// binapi-generator: v0.4.0-dev // VPP: 21.06-release // source: /usr/share/vpp/api/core/vpe_types.api.json @@ -86,18 +86,22 @@ func NewTimestamp(t time.Time) Timestamp { ns := float64(sec) + float64(nsec/1e9) return Timestamp(ns) } + func (x Timestamp) ToTime() time.Time { ns := int64(x * 1e9) sec := ns / 1e9 nsec := ns % 1e9 return time.Unix(sec, nsec) } + func (x Timestamp) String() string { return x.ToTime().String() } + func (x *Timestamp) MarshalText() ([]byte, error) { return []byte(x.ToTime().Format(time.RFC3339Nano)), nil } + func (x *Timestamp) UnmarshalText(text []byte) error { t, err := time.Parse(time.RFC3339Nano, string(text)) if err != nil {