duration

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	// Signed nanoseconds of the span of time. Must be from -315,576,000,000,000
	// to +315,576,000,000,000 inclusive. Note: these bounds are computed from:
	// 1000 ms/sec * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
	Nanos int64 `protobuf:"varint,1,opt,name=nanos,proto3" json:"nanos,omitempty"`
	// is set to true if the timestamp is null
	IsNotNull            bool     `protobuf:"varint,2,opt,name=is_not_null,json=isNotNull,proto3" json:"is_not_null,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Duration ...

func (*Duration) Descriptor

func (*Duration) Descriptor() ([]byte, []int)

func (*Duration) Duration

func (m *Duration) Duration() time.Duration

Duration returns a golang duration object

func (*Duration) GetIsNotNull

func (m *Duration) GetIsNotNull() bool

func (*Duration) GetNanos

func (m *Duration) GetNanos() int64

func (*Duration) ImplementsGraphQLType

func (m *Duration) ImplementsGraphQLType(name string) bool

ImplementsGraphQLType is required by the graphql custom scalar interface this defines the name used in the schema to declare a null duration type

func (*Duration) IsNull

func (m *Duration) IsNull() bool

IsNull will return if the current duration is null

func (Duration) MarshalJSON

func (m Duration) MarshalJSON() ([]byte, error)

MarshalJSON will return the content as json value, this is also called by graphql to generate the response

func (*Duration) MarshalJSONPB

func (m *Duration) MarshalJSONPB(_ *jsonpb.Marshaler) ([]byte, error)

func (*Duration) ProtoMessage

func (*Duration) ProtoMessage()

func (*Duration) Reset

func (m *Duration) Reset()

func (*Duration) Scan

func (m *Duration) Scan(value interface{}) error

Scan implements the Scanner interface of the database driver

func (*Duration) Set

func (m *Duration) Set(value time.Duration)

Set will set the duration to the given duration

func (*Duration) SetNull

func (m *Duration) SetNull()

SetNull will clear the duration

func (*Duration) String

func (m *Duration) String() string

func (*Duration) UnmarshalGraphQL

func (m *Duration) UnmarshalGraphQL(input interface{}) error

UnmarshalGraphQL is required by the graphql custom scalar interface this wraps the null duration

func (*Duration) UnmarshalJSON

func (m *Duration) UnmarshalJSON(input []byte) error

UnmarshalJSON is used to convert the json representation into a duration

func (*Duration) UnmarshalJSONPB

func (m *Duration) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, input []byte) error

func (Duration) Value

func (m Duration) Value() (driver.Value, error)

Value implements the db driver Valuer interface

func (*Duration) XXX_DiscardUnknown

func (m *Duration) XXX_DiscardUnknown()

func (*Duration) XXX_Marshal

func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Duration) XXX_Merge

func (m *Duration) XXX_Merge(src proto.Message)

func (*Duration) XXX_Size

func (m *Duration) XXX_Size() int

func (*Duration) XXX_Unmarshal

func (m *Duration) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL