v1

package
v1.7.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Time

type Time struct {
	time.Time `protobuf:"-"`
}

Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.

+protobuf.options.marshal=false +protobuf.as=Timestamp +protobuf.options.(gogoproto.goproto_stringer)=false

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the supplied parameters by wrapping time.Date.

func NewTime

func NewTime(time time.Time) Time

NewTime returns a wrapped instance of the provided time

func Now

func Now() Time

Now returns the current local time.

func Unix

func Unix(sec int64, nsec int64) Time

Unix returns the local time corresponding to the given Unix time by wrapping time.Unix.

func (Time) Before

func (t Time) Before(u Time) bool

Before reports whether the time instant t is before u.

func (Time) DeepCopy

func (t Time) DeepCopy() Time

DeepCopy returns a deep-copy of the Time value. The underlying time.Time type is effectively immutable in the time API, so it is safe to copy-by-assign, despite the presence of (unexported) Pointer fields.

func (Time) Equal

func (t Time) Equal(u Time) bool

Equal reports whether the time instant t is equal to u.

func (*Time) Fuzz

func (t *Time) Fuzz(c fuzz.Continue)

Fuzz satisfies fuzz.Interface.

func (*Time) IsZero

func (t *Time) IsZero() bool

IsZero returns true if the value is nil or time is zero.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Time) MarshalQueryParameter

func (t Time) MarshalQueryParameter() (string, error)

MarshalQueryParameter converts to a URL query parameter value

func (Time) OpenAPIDefinition

func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition

func (Time) Rfc3339Copy

func (t Time) Rfc3339Copy() Time

Rfc3339Copy returns a copy of the Time at second-level precision.

func (Time) String

func (t Time) String() string

String returns the representation of the time.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*Time) UnmarshalQueryParameter

func (t *Time) UnmarshalQueryParameter(str string) error

UnmarshalQueryParameter converts from a URL query parameter value to an object

Jump to

Keyboard shortcuts

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