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 ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func Get(typ, format string) ([]byte, error)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type DateOnly
- type DateTime
- type DateTimeRFC2616
- type DatetimeOnly
- type TimeOnly
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func Get ¶
Get gets Go code of a specific RAML Date type The code returned is without `package date` line
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type DateOnly ¶
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 ¶
MarshalJSON override marshalJSON
func (*DateOnly) UnmarshalJSON ¶
UnmarshalJSON override unmarshalJSON
type DateTime ¶
DateTime is timestamp in "date-time" format defined in RFC3339
func (*DateTime) MarshalJSON ¶
MarshalJSON override marshalJSON
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON override unmarshalJSON
type DateTimeRFC2616 ¶
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 ¶
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 ¶
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 ¶
MarshalJSON override marshalJSON
func (*TimeOnly) UnmarshalJSON ¶
UnmarshalJSON override unmarshalJSON