Documentation
¶
Overview ¶
Package datetime implements marshalling of Go DateTime values into Noms structs with type DateTimeType.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DateTimeType, _ = types.MakeStructTypeFromFields(datetypename, types.FieldMap{
"secSinceEpoch": types.PrimitiveTypeMap[types.FloatKind],
})
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.
var Epoch = DateTime{time.Unix(0, 0)}
Epoch is the unix Epoch. This time is very consistent, which makes it useful for testing or checking for uninitialized values
Functions ¶
func RegisterHRSCommenter ¶
Types ¶
type DateTime ¶
DateTime implements marshaling of time.Time to and from Noms.
func (DateTime) MarshalNoms ¶
MarshalNoms makes DateTime implement marshal.Marshaler and it makes DateTime marshal into a Noms struct with type DateTimeType.
func (DateTime) MarshalNomsType ¶
MarshalNomsType makes DateTime implement marshal.TypeMarshaler and it allows marshal.MarshalType to work with DateTime.
func (*DateTime) UnmarshalNoms ¶
func (dt *DateTime) UnmarshalNoms(ctx context.Context, nbf *types.NomsBinFormat, 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
type DateTimeCommenter ¶
type DateTimeCommenter struct {
// contains filtered or unexported fields
}