summaryrefslogtreecommitdiff
path: root/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go')
-rw-r--r--vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go180
1 files changed, 0 insertions, 180 deletions
diff --git a/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go b/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
index d42764743..38439fa99 100644
--- a/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
+++ b/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
@@ -47,183 +47,3 @@ func (*timestamp) String() string { return "timestamp<string>" }
func init() {
RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp")
}
-
-func (o *Buffer) decTimestamp() (time.Time, error) {
- b, err := o.DecodeRawBytes(true)
- if err != nil {
- return time.Time{}, err
- }
- tproto := &timestamp{}
- if err := Unmarshal(b, tproto); err != nil {
- return time.Time{}, err
- }
- return timestampFromProto(tproto)
-}
-
-func (o *Buffer) dec_time(p *Properties, base structPointer) error {
- t, err := o.decTimestamp()
- if err != nil {
- return err
- }
- setPtrCustomType(base, p.field, &t)
- return nil
-}
-
-func (o *Buffer) dec_ref_time(p *Properties, base structPointer) error {
- t, err := o.decTimestamp()
- if err != nil {
- return err
- }
- setCustomType(base, p.field, &t)
- return nil
-}
-
-func (o *Buffer) dec_slice_time(p *Properties, base structPointer) error {
- t, err := o.decTimestamp()
- if err != nil {
- return err
- }
- newBas := appendStructPointer(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType)))
- var zero field
- setPtrCustomType(newBas, zero, &t)
- return nil
-}
-
-func (o *Buffer) dec_slice_ref_time(p *Properties, base structPointer) error {
- t, err := o.decTimestamp()
- if err != nil {
- return err
- }
- newBas := appendStructPointer(base, p.field, reflect.SliceOf(timeType))
- var zero field
- setCustomType(newBas, zero, &t)
- return nil
-}
-
-func size_time(p *Properties, base structPointer) (n int) {
- structp := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(structp) {
- return 0
- }
- tim := structPointer_Interface(structp, timeType).(*time.Time)
- t, err := timestampProto(*tim)
- if err != nil {
- return 0
- }
- size := Size(t)
- return size + sizeVarint(uint64(size)) + len(p.tagcode)
-}
-
-func (o *Buffer) enc_time(p *Properties, base structPointer) error {
- structp := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(structp) {
- return ErrNil
- }
- tim := structPointer_Interface(structp, timeType).(*time.Time)
- t, err := timestampProto(*tim)
- if err != nil {
- return err
- }
- data, err := Marshal(t)
- if err != nil {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- return nil
-}
-
-func size_ref_time(p *Properties, base structPointer) (n int) {
- tim := structPointer_InterfaceAt(base, p.field, timeType).(*time.Time)
- t, err := timestampProto(*tim)
- if err != nil {
- return 0
- }
- size := Size(t)
- return size + sizeVarint(uint64(size)) + len(p.tagcode)
-}
-
-func (o *Buffer) enc_ref_time(p *Properties, base structPointer) error {
- tim := structPointer_InterfaceAt(base, p.field, timeType).(*time.Time)
- t, err := timestampProto(*tim)
- if err != nil {
- return err
- }
- data, err := Marshal(t)
- if err != nil {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- return nil
-}
-
-func size_slice_time(p *Properties, base structPointer) (n int) {
- ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType))).(*[]*time.Time)
- tims := *ptims
- for i := 0; i < len(tims); i++ {
- if tims[i] == nil {
- return 0
- }
- tproto, err := timestampProto(*tims[i])
- if err != nil {
- return 0
- }
- size := Size(tproto)
- n += len(p.tagcode) + size + sizeVarint(uint64(size))
- }
- return n
-}
-
-func (o *Buffer) enc_slice_time(p *Properties, base structPointer) error {
- ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType))).(*[]*time.Time)
- tims := *ptims
- for i := 0; i < len(tims); i++ {
- if tims[i] == nil {
- return errRepeatedHasNil
- }
- tproto, err := timestampProto(*tims[i])
- if err != nil {
- return err
- }
- data, err := Marshal(tproto)
- if err != nil {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- }
- return nil
-}
-
-func size_slice_ref_time(p *Properties, base structPointer) (n int) {
- ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(timeType)).(*[]time.Time)
- tims := *ptims
- for i := 0; i < len(tims); i++ {
- tproto, err := timestampProto(tims[i])
- if err != nil {
- return 0
- }
- size := Size(tproto)
- n += len(p.tagcode) + size + sizeVarint(uint64(size))
- }
- return n
-}
-
-func (o *Buffer) enc_slice_ref_time(p *Properties, base structPointer) error {
- ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(timeType)).(*[]time.Time)
- tims := *ptims
- for i := 0; i < len(tims); i++ {
- tproto, err := timestampProto(tims[i])
- if err != nil {
- return err
- }
- data, err := Marshal(tproto)
- if err != nil {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- }
- return nil
-}