datetime

package
v0.0.0-...-22f70f5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package datetime implements marshalling of Go DateTime values into Noms structs with type DateTimeType.

Index

Constants

This section is empty.

Variables

View Source
var DateTimeType = types.MakeStructTypeFromFields("DateTime", types.FieldMap{
	"secSinceEpoch": types.NumberType,
})

DateTimeType is the Noms type used to represent date time objects in Noms. The field secSinceEpoch may contain fractions in cases where seconds are not sufficient.

Functions

This section is empty.

Types

type DateTime

type DateTime time.Time

DateTime is an alias for time.Time that allows us to marshal date time to Noms.

func (DateTime) MarshalNoms

func (dt DateTime) MarshalNoms() (types.Value, error)

MarshalNoms makes DateTime implement marshal.Marshaler and it makes DateTime marshal into a Noms struct with type DateTimeType.

func (DateTime) MarshalNomsType

func (dt DateTime) MarshalNomsType() (*types.Type, error)

MarshalNomsType makes DateTime implement marshal.TypeMarshaler and it allows marshal.MarshalType to work with DateTime.

func (*DateTime) UnmarshalNoms

func (dt *DateTime) UnmarshalNoms(v types.Value) error

UnmarshalNoms makes DateTime implement marshal.Unmarshaler and it allows Noms struct with type DateTimeType able to be unmarshaled onto a DateTime Go struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳