date

package
v0.0.0-...-4799e85 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package date provides implementation of various RAML Date type. code generator will use code in this package to generate RAML date code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(typ, format string) ([]byte, error)

Get gets Go code of a specific RAML Date type The code returned is without `package date` line

Types

type DateOnly

type DateOnly time.Time

DateOnly represent RAML date-only type The "full-date" notation of RFC3339, namely yyyy-mm-dd. Does not support time or time zone-offset notation.

func (*DateOnly) MarshalJSON

func (do *DateOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateOnly) String

func (do *DateOnly) String() string

String returns string representation

func (*DateOnly) UnmarshalJSON

func (do *DateOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DateTime

type DateTime time.Time

DateTime is timestamp in "date-time" format defined in RFC3339

func (*DateTime) MarshalJSON

func (dt *DateTime) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateTime) String

func (dt *DateTime) String() string

String returns it's string representation

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DateTimeRFC2616

type DateTimeRFC2616 time.Time

DateTimeRFC2616 is timestamp in RFC2616 format

func (*DateTimeRFC2616) MarshalJSON

func (dt *DateTimeRFC2616) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DateTimeRFC2616) String

func (dt *DateTimeRFC2616) String() string

String returns it's string representation

func (*DateTimeRFC2616) UnmarshalJSON

func (dt *DateTimeRFC2616) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type DatetimeOnly

type DatetimeOnly time.Time

DatetimeOnly represent RAML datetime-only type Combined date-only and time-only with a separator of "T", namely yyyy-mm-ddThh:mm:ss[.ff...]. Does not support a time zone offset.

func (*DatetimeOnly) MarshalJSON

func (dto *DatetimeOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*DatetimeOnly) String

func (dto *DatetimeOnly) String() string

String returns string representation

func (*DatetimeOnly) UnmarshalJSON

func (dto *DatetimeOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

type TimeOnly

type TimeOnly time.Time

TimeOnly represent RAML time-only type. The "partial-time" notation of RFC3339, namely hh:mm:ss[.ff...]. Does not support date or time zone-offset notation.

func (*TimeOnly) MarshalJSON

func (to *TimeOnly) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*TimeOnly) String

func (to *TimeOnly) String() string

String returns string representation

func (*TimeOnly) UnmarshalJSON

func (to *TimeOnly) UnmarshalJSON(b []byte) error

UnmarshalJSON override unmarshalJSON

Jump to

Keyboard shortcuts

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