Documentation
¶
Index ¶
- Constants
- Variables
- func ToGomentTime(time time.Time) (*goment.Goment, error)
- type Date
- type DateTime
- type ErrCannotParseTemporalValue
- type ErrIncompatibleTypes
- type ErrNotAStringValue
- type GDay
- type GMonth
- type GMonthDay
- type GYear
- type GYearMonth
- type JSONBooleanParser
- type JSONDateParser
- type JSONDateTimeParser
- type JSONTimeParser
- type PatternDateParser
- type PatternDateTimeParser
- type PatternTimeParser
- type TimeOfDay
- type UnixTime
- type UnixTimeNano
- type UnixTimeNanoParser
- type UnixTimeParser
- type XMLBooleanParser
- type XSDDateParser
- type XSDDateTimeParser
- type XSDGDayParser
- type XSDGMonthDayParser
- type XSDGMonthParser
- type XSDGYearMonthParser
- type XSDGYearParser
- type XSDTimeParser
Constants ¶
const JSON = "https:/json-schema.org/"
const Unix = "https://unixtime.org/"
const XSD = "http://www.w3.org/2001/XMLSchema/"
Variables ¶
var GoTimeFormatTerm = ls.NewTerm(ls.LS, "goTimeFormat", false, false, ls.SetComposition, nil)
var JSONBooleanTerm = ls.NewTerm(JSON, "boolean", false, false, ls.OverrideComposition, struct { JSONBooleanParser }{ JSONBooleanParser{}, })
var JSONDateTerm = ls.NewTerm(JSON, "date", false, false, ls.OverrideComposition, struct { JSONDateParser }{ JSONDateParser: JSONDateParser{}, })
JSONDate is a node-type that identifies the underlying value as a JSON date value
YYYY-MM-DD
var JSONDateTimeTerm = ls.NewTerm(JSON, "date-time", false, false, ls.OverrideComposition, struct { JSONDateTimeParser }{ JSONDateTimeParser: JSONDateTimeParser{}, })
JSONDateTime is a node-type that identifies the underlying value as a JSON datetime value, RFC3339 or RFC3339Nano
YYYY-MM-DDTHH:mm:ssZ YYYY-MM-DDTHH:mm:ss.00000Z
var JSONTimeTerm = ls.NewTerm(JSON, "time", false, false, ls.OverrideComposition, struct { JSONTimeParser }{ JSONTimeParser: JSONTimeParser{}, })
JSONTime is a node-type that identifies the underlying value as a JSON time value
HH:mm HH:mm:ss HH:mm:ssZ
var MomentTimeFormatTerm = ls.NewTerm(ls.LS, "momentTimeFormat", false, false, ls.SetComposition, nil)
var PatternDateTerm = ls.NewTerm(ls.LS, "date", false, false, ls.OverrideComposition, struct { PatternDateParser }{ PatternDateParser: PatternDateParser{}, })
var PatternDateTimeTerm = ls.NewTerm(ls.LS, "dateTime", false, false, ls.OverrideComposition, struct { PatternDateTimeParser }{ PatternDateTimeParser: PatternDateTimeParser{}, })
var PatternTimeTerm = ls.NewTerm(ls.LS, "time", false, false, ls.OverrideComposition, struct { PatternTimeParser }{ PatternTimeParser: PatternTimeParser{}, })
var UnixTimeNanoTerm = ls.NewTerm(Unix, "timeNano", false, false, ls.OverrideComposition, struct { UnixTimeNanoParser }{ UnixTimeNanoParser: UnixTimeNanoParser{}, })
var UnixTimeTerm = ls.NewTerm(Unix, "time", false, false, ls.OverrideComposition, struct { UnixTimeParser }{ UnixTimeParser: UnixTimeParser{}, })
var XMLBooleanTerm = ls.NewTerm(XSD, "boolean", false, false, ls.OverrideComposition, struct { XMLBooleanParser }{ XMLBooleanParser{}, })
var XSDDateTerm = ls.NewTerm(XSD, "date", false, false, ls.OverrideComposition, struct { XSDDateParser }{ XSDDateParser: XSDDateParser{}, })
XSDDate is a node-type that identifies the underlying value as an XML date. The format is:
[-]CCYY-MM-DD[Z|(+|-)hh:mm]
var XSDDateTimeTerm = ls.NewTerm(XSD, "dateTime", false, false, ls.OverrideComposition, struct { XSDDateTimeParser }{ XSDDateTimeParser: XSDDateTimeParser{}, })
XSDDateTime is a node-type that identifies the underlying value as an XML date-time value
var XSDGDayTerm = ls.NewTerm(XSD, "gDay", false, false, ls.OverrideComposition, struct { XSDGDayParser }{ XSDGDayParser: XSDGDayParser{}, })
XSDGday can be used as a node-type to interpret the underlying value as a day (GDay)
var XSDGMonthDayTerm = ls.NewTerm(XSD, "gMonthDay", false, false, ls.OverrideComposition, struct { XSDGMonthDayParser }{ XSDGMonthDayParser: XSDGMonthDayParser{}, })
XSDMonthDay can be used as a node-type to interpret the underlying value as a MM-DD
var XSDGMonthTerm = ls.NewTerm(XSD, "gMonth", false, false, ls.OverrideComposition, struct { XSDGMonthParser }{ XSDGMonthParser: XSDGMonthParser{}, })
XSDGMonth can be used as node-type to interpret the underlying value as a month (int)
var XSDGYearMonthTerm = ls.NewTerm(XSD, "gYearMonth", false, false, ls.OverrideComposition, struct { XSDGYearMonthParser }{ XSDGYearMonthParser: XSDGYearMonthParser{}, })
XSDGYearMonth can be used as a node-type to interpret the underlying value as a YYYY-MM
var XSDGYearTerm = ls.NewTerm(XSD, "gYear", false, false, ls.OverrideComposition, struct { XSDGYearParser }{ XSDGYearParser: XSDGYearParser{}, })
XSDGYear can be used as a node-type to interpret the underlying value as a year value (int)
var XSDTimeTerm = ls.NewTerm(XSD, "time", false, false, ls.OverrideComposition, struct { XSDTimeParser }{ XSDTimeParser: XSDTimeParser{}, })
XSDTime is a node-type that identifies the underlying value as an XML time.
Functions ¶
Types ¶
type DateTime ¶
type ErrCannotParseTemporalValue ¶
type ErrCannotParseTemporalValue string
func (ErrCannotParseTemporalValue) Error ¶
func (e ErrCannotParseTemporalValue) Error() string
type ErrIncompatibleTypes ¶
type ErrIncompatibleTypes struct {
// contains filtered or unexported fields
}
func (ErrIncompatibleTypes) Error ¶
func (e ErrIncompatibleTypes) Error() string
type ErrNotAStringValue ¶
type ErrNotAStringValue struct {
NodeID string
}
func (ErrNotAStringValue) Error ¶
func (e ErrNotAStringValue) Error() string
type GYearMonth ¶
GYearMonth is XML Gregorian part of Year/Month
type JSONBooleanParser ¶
type JSONBooleanParser struct{}
func (JSONBooleanParser) GetNodeValue ¶
func (JSONBooleanParser) GetNodeValue(node graph.Node) (interface{}, error)
func (JSONBooleanParser) SetNodeValue ¶
func (JSONBooleanParser) SetNodeValue(node graph.Node, value interface{}) error
type JSONDateParser ¶
type JSONDateParser struct{}
func (JSONDateParser) GetNodeValue ¶
func (JSONDateParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue parses a JSON date
YYYY-MM-DD
func (JSONDateParser) SetNodeValue ¶
func (JSONDateParser) SetNodeValue(node graph.Node, value interface{}) error
SetValue gets a target node and it's go native value, and sets the value of the target node to an JSONDate
type JSONDateTimeParser ¶
type JSONDateTimeParser struct{}
func (JSONDateTimeParser) GetNodeValue ¶
func (JSONDateTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue parses a JSON date-time
YYYY-MM-DD
func (JSONDateTimeParser) SetNodeValue ¶
func (JSONDateTimeParser) SetNodeValue(node graph.Node, value interface{}) error
"2006-01-02T11:11:11Z07:00" -> Note: uses a 24Hour based clock "2006-01-02T11:11:11.999999999Z07:00"
type JSONTimeParser ¶
type JSONTimeParser struct{}
func (JSONTimeParser) GetNodeValue ¶
func (JSONTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue parses a JSON time
HH:mm HH:mm:ss HH:mm:ssZ
func (JSONTimeParser) SetNodeValue ¶
func (JSONTimeParser) SetNodeValue(node graph.Node, value interface{}) error
type PatternDateParser ¶
type PatternDateParser struct{}
func (PatternDateParser) GetNodeValue ¶
func (PatternDateParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue looks at the goTimeFormat, momentTimeFormat properties in the node, and parses the datetime using that. The format property can be an array, giving all possible formats
func (PatternDateParser) SetNodeValue ¶
func (PatternDateParser) SetNodeValue(node graph.Node, value interface{}) error
type PatternDateTimeParser ¶
type PatternDateTimeParser struct{}
func (PatternDateTimeParser) GetNodeValue ¶
func (PatternDateTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue looks at the goTimeFormat, momentTimeFormat properties in the node, and parses the datetime using that. The format property can be an array, giving all possible formats
func (PatternDateTimeParser) SetNodeValue ¶
func (PatternDateTimeParser) SetNodeValue(node graph.Node, value interface{}) error
type PatternTimeParser ¶
type PatternTimeParser struct{}
func (PatternTimeParser) GetNodeValue ¶
func (PatternTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue looks at the goTimeFormat, momentTimeFormat properties in the node, and parses the datetime using that. The format property can be an array, giving all possible formats
func (PatternTimeParser) SetNodeValue ¶
func (PatternTimeParser) SetNodeValue(node graph.Node, value interface{}) error
type TimeOfDay ¶
type UnixTimeNano ¶
func (UnixTimeNano) ToTime ¶
func (u UnixTimeNano) ToTime() time.Time
type UnixTimeNanoParser ¶
type UnixTimeNanoParser struct{}
func (UnixTimeNanoParser) GetNodeValue ¶
func (UnixTimeNanoParser) GetNodeValue(node graph.Node) (interface{}, error)
func (UnixTimeNanoParser) SetNodeValue ¶
func (UnixTimeNanoParser) SetNodeValue(node graph.Node, value interface{}) error
type UnixTimeParser ¶
type UnixTimeParser struct{}
func (UnixTimeParser) GetNodeValue ¶
func (UnixTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
func (UnixTimeParser) SetNodeValue ¶
func (UnixTimeParser) SetNodeValue(node graph.Node, value interface{}) error
type XMLBooleanParser ¶
type XMLBooleanParser struct{}
func (XMLBooleanParser) GetNodeValue ¶
func (XMLBooleanParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XMLBooleanParser) SetNodeValue ¶
func (XMLBooleanParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDDateParser ¶
type XSDDateParser struct{}
func (XSDDateParser) GetNodeValue ¶
func (XSDDateParser) GetNodeValue(node graph.Node) (interface{}, error)
ParseValue parses an XSDDate value.
[-]CCYY-MM-DD[Z|(+|-)hh:mm]
func (XSDDateParser) SetNodeValue ¶
func (XSDDateParser) SetNodeValue(node graph.Node, value interface{}) error
SetValue gets a target node and it's go native value, and sets the value of the target node to an XSDDate
type XSDDateTimeParser ¶
type XSDDateTimeParser struct{}
func (XSDDateTimeParser) GetNodeValue ¶
func (XSDDateTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDDateTimeParser) SetNodeValue ¶
func (XSDDateTimeParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDGDayParser ¶
type XSDGDayParser struct{}
func (XSDGDayParser) GetNodeValue ¶
func (XSDGDayParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDGDayParser) SetNodeValue ¶
func (XSDGDayParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDGMonthDayParser ¶
type XSDGMonthDayParser struct{}
func (XSDGMonthDayParser) GetNodeValue ¶
func (XSDGMonthDayParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDGMonthDayParser) SetNodeValue ¶
func (XSDGMonthDayParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDGMonthParser ¶
type XSDGMonthParser struct{}
func (XSDGMonthParser) GetNodeValue ¶
func (XSDGMonthParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDGMonthParser) SetNodeValue ¶
func (XSDGMonthParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDGYearMonthParser ¶
type XSDGYearMonthParser struct{}
func (XSDGYearMonthParser) GetNodeValue ¶
func (XSDGYearMonthParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDGYearMonthParser) SetNodeValue ¶
func (XSDGYearMonthParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDGYearParser ¶
type XSDGYearParser struct{}
func (XSDGYearParser) GetNodeValue ¶
func (XSDGYearParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDGYearParser) SetNodeValue ¶
func (XSDGYearParser) SetNodeValue(node graph.Node, value interface{}) error
type XSDTimeParser ¶
type XSDTimeParser struct{}
func (XSDTimeParser) GetNodeValue ¶
func (XSDTimeParser) GetNodeValue(node graph.Node) (interface{}, error)
func (XSDTimeParser) SetNodeValue ¶
func (XSDTimeParser) SetNodeValue(node graph.Node, value interface{}) error