Documentation ¶
Index ¶
- Constants
- Variables
- func BuildMeasureNodes(ctx *ls.Context, builder ls.GraphBuilder, measureSchemaNode *lpg.Node) error
- func BuildMeasureNodesForLayer(ctx *ls.Context, bldr ls.GraphBuilder, layer *ls.Layer) error
- func SetMeasureService(ctx *ls.Context, svc MeasureService)
- func SetMeasureValue(ctx *ls.Context, svc MeasureService, measureNode, schemaNode *lpg.Node, ...) error
- func ToGomentTime(time time.Time) (*goment.Goment, error)
- type Date
- type DateTime
- type DecimalParser
- type ErrCannotParseTemporalValue
- type ErrIncompatibleTypes
- type ErrMeasureProcessing
- type ErrMultipleNodesMatch
- type ErrNotAMeasure
- type ErrOverflow
- type GDay
- type GMonth
- type GMonthDay
- type GYear
- type GYearMonth
- type JSONBooleanParser
- type JSONDateParser
- type JSONDateTimeParser
- type JSONNumberParser
- type JSONTimeParser
- type Measure
- type MeasureService
- type PatternDateParser
- type PatternDateTimeParser
- type PatternTimeParser
- type SignedIntParser
- type TimeOfDay
- type UnixTime
- type UnixTimeNano
- type UnixTimeNanoParser
- type UnixTimeParser
- type UnsignedIntParser
- 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", "ls:goTimeFormat").SetComposition(ls.SetComposition).Register()
var JSONBooleanTerm = ls.NewTerm(JSON, "boolean", "json:boolean").SetComposition(ls.OverrideComposition).SetMetadata(struct { JSONBooleanParser }{ JSONBooleanParser{}, }).Register()
var JSONDateTerm = ls.NewTerm(JSON, "date", "json:date").SetComposition(ls.OverrideComposition).SetMetadata(struct { JSONDateParser }{ JSONDateParser: JSONDateParser{}, }).Register()
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", "json:date-time").SetComposition(ls.OverrideComposition).SetMetadata(struct { JSONDateTimeParser }{ JSONDateTimeParser: JSONDateTimeParser{}, }).Register()
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 JSONInteger = ls.NewTerm(JSON, "integer", "json:integer").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int8] }{ SignedIntParser[int8]{}, }).Register()
var JSONNumber = ls.NewTerm(JSON, "number", "json:number").SetComposition(ls.OverrideComposition).SetMetadata(struct { JSONNumberParser }{ JSONNumberParser{}, }).Register()
var JSONTimeTerm = ls.NewTerm(JSON, "time", "json:time").SetComposition(ls.OverrideComposition).SetMetadata(struct { JSONTimeParser }{ JSONTimeParser: JSONTimeParser{}, }).Register()
JSONTime is a node-type that identifies the underlying value as a JSON time value
HH:mm HH:mm:ss HH:mm:ssZ
var MeasureTerm = ls.NewTerm(ls.LS, "Measure", "Measure").SetComposition(ls.OverrideComposition).SetMetadata(struct {
measureParser
}{
measureParser{},
}).Register()
MeasureTerm is used as a valuetype for a measure node
var MeasureUnitDomainTerm = ls.NewTerm(ls.LS, "measure/unitDomain").SetComposition(ls.OverrideComposition).Register()
MeasureUnitDomainTerm is a node property that specifies that the measure is of a certain domain
var MeasureUnitExpr = ls.NewTerm(ls.LS, "measure/unitExpr").SetComposition(ls.OverrideComposition).SetMetadata(ls.CompileOCSemantics{}).Register()
MeasureUnitExpr gives the expression that returns the unit. The result can be a node or a value. The expression is evaluated with (valueNode) bound to the value node of the unit expr
var MeasureUnitNode = ls.NewTerm(ls.LS, "measure/unitNode").SetComposition(ls.OverrideComposition).Register()
MeasureUnitNode gives the schema node id containing the unit. This node must appear under the common parent with measure node
var MeasureUnitTerm = ls.NewTerm(ls.LS, "measure/unit").SetComposition(ls.OverrideComposition).Register()
MeasureUnitTerm is a node property term giving measure unit
var MeasureUseUnitTerm = ls.NewTerm(ls.LS, "measure/useUnit").SetComposition(ls.OverrideComposition).Register()
MeasureUseUnitTerm is a node property that specifies that all measures must be converted to this unit
var MeasureValueNode = ls.NewTerm(ls.LS, "measure/valueNode").SetComposition(ls.OverrideComposition).Register()
MeasureValueNode gives the schema node id containing the value. This node must appear under the common parent with measure node
var MeasureValueNodeExpr = ls.NewTerm(ls.LS, "measure/valueNodeExpr").SetComposition(ls.OverrideComposition).SetMetadata(ls.CompileOCSemantics{}).Register()
MeasureValueExpr gives the expression that returns the measured value node. The result must be a node.
var MeasureValueTerm = ls.NewTerm(ls.LS, "measure/value").SetComposition(ls.OverrideComposition).Register()
MeasureValueTerm is a node property term giving measure value.
var MomentTimeFormatTerm = ls.NewTerm(ls.LS, "momentTimeFormat", "ls:momentTimeFormat").SetComposition(ls.SetComposition).Register()
var PatternDateTerm = ls.NewTerm(ls.LS, "date", "ls:date").SetComposition(ls.OverrideComposition).SetMetadata(struct { PatternDateParser }{ PatternDateParser: PatternDateParser{}, }).Register()
var PatternDateTimeTerm = ls.NewTerm(ls.LS, "dateTime", "ls:dateTime").SetComposition(ls.OverrideComposition).SetMetadata(struct { PatternDateTimeParser }{ PatternDateTimeParser: PatternDateTimeParser{}, }).Register()
var PatternTimeTerm = ls.NewTerm(ls.LS, "time", "ls:time").SetComposition(ls.OverrideComposition).SetMetadata(struct { PatternTimeParser }{ PatternTimeParser: PatternTimeParser{}, }).Register()
var UnixTimeNanoTerm = ls.NewTerm(Unix, "timeNano", "unix:timeNano").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnixTimeNanoParser }{ UnixTimeNanoParser: UnixTimeNanoParser{}, }).Register()
var UnixTimeTerm = ls.NewTerm(Unix, "time", "unix:time").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnixTimeParser }{ UnixTimeParser: UnixTimeParser{}, }).Register()
var XMLBooleanTerm = ls.NewTerm(XSD, "boolean", "xsd:boolean", "xs:boolean").SetComposition(ls.OverrideComposition).SetMetadata(struct { XMLBooleanParser }{ XMLBooleanParser{}, }).Register()
var XSDByte = ls.NewTerm(XSD, "byte", "xsd:byte", "xs:byte").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int8] }{ SignedIntParser[int8]{}, }).Register()
var XSDDateTerm = ls.NewTerm(XSD, "date", "xsd:date", "xs:date").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDDateParser }{ XSDDateParser: XSDDateParser{}, }).Register()
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", "xsd:dateTime", "xs:dateTime").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDDateTimeParser }{ XSDDateTimeParser: XSDDateTimeParser{}, }).Register()
XSDDateTime is a node-type that identifies the underlying value as an XML date-time value
var XSDDecimal = ls.NewTerm(XSD, "decimal", "xsd:decimal", "xs:decimal", "ls:float", ls.LS+"float", "ls:double", ls.LS+"double", "double", "float").SetComposition(ls.OverrideComposition).SetMetadata(struct { DecimalParser }{ DecimalParser{}, }).Register()
var XSDGDayTerm = ls.NewTerm(XSD, "gDay", "xsd:gDay", "xs:gDay").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDGDayParser }{ XSDGDayParser: XSDGDayParser{}, }).Register()
XSDGday can be used as a node-type to interpret the underlying value as a day (GDay)
var XSDGMonthDayTerm = ls.NewTerm(XSD, "gMonthDay", "xsd:gMonthDay", "xs:gMonthDay").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDGMonthDayParser }{ XSDGMonthDayParser: XSDGMonthDayParser{}, }).Register()
XSDMonthDay can be used as a node-type to interpret the underlying value as a MM-DD
var XSDGMonthTerm = ls.NewTerm(XSD, "gMonth", "xsd:gMonth", "xs:gMonth").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDGMonthParser }{ XSDGMonthParser: XSDGMonthParser{}, }).Register()
XSDGMonth can be used as node-type to interpret the underlying value as a month (int)
var XSDGYearMonthTerm = ls.NewTerm(XSD, "gYearMonth", "xsd:gYearMonth", "xs:gYearMonth").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDGYearMonthParser }{ XSDGYearMonthParser: XSDGYearMonthParser{}, }).Register()
XSDGYearMonth can be used as a node-type to interpret the underlying value as a YYYY-MM
var XSDGYearTerm = ls.NewTerm(XSD, "gYear", "xsd:gYear", "xs:gYear").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDGYearParser }{ XSDGYearParser: XSDGYearParser{}, }).Register()
XSDGYear can be used as a node-type to interpret the underlying value as a year value (int)
var XSDInt = ls.NewTerm(XSD, "int", "xsd:int", "xs:int", "xsd:integer", "xs:integer", XSD+"integer").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int32] }{ SignedIntParser[int32]{}, }).Register()
var XSDLong = ls.NewTerm(XSD, "long", "xsd:long", "xs:long", "int", "integer", ls.LS+"int", ls.LS+"integer", "ls:int", "ls:integer").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int64] }{ SignedIntParser[int64]{}, }).Register()
var XSDNegativeInteger = ls.NewTerm(XSD, "negativeInteger", "xsd:negativeInteger", "xs:negativeInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int64] }{ SignedIntParser[int64]{ max: &negativeOne64, }, }).Register()
var XSDNonNegativeInteger = ls.NewTerm(XSD, "nonNegativeInteger", "xsd:nonNegativeInteger", "xs:nonNegativeInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int64] }{ SignedIntParser[int64]{ min: &zero64, }, }).Register()
var XSDNonPositiverInteger = ls.NewTerm(XSD, "nonPositiveInteger", "xsd:nonPositiveInteger", "xs:nonPositiveInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int64] }{ SignedIntParser[int64]{ max: &zero64, }, }).Register()
var XSDPositiveInteger = ls.NewTerm(XSD, "positiveInteger", "xsd:positiveInteger", "xs:positiveInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int64] }{ SignedIntParser[int64]{ min: &one64, }, }).Register()
var XSDShort = ls.NewTerm(XSD, "short", "xsd:short", "xs:short").SetComposition(ls.OverrideComposition).SetMetadata(struct { SignedIntParser[int16] }{ SignedIntParser[int16]{}, }).Register()
var XSDTimeTerm = ls.NewTerm(XSD, "time", "xsd:time", "xs:time").SetComposition(ls.OverrideComposition).SetMetadata(struct { XSDTimeParser }{ XSDTimeParser: XSDTimeParser{}, }).Register()
XSDTime is a node-type that identifies the underlying value as an XML time.
var XSDUnsignedByte = ls.NewTerm(XSD, "unsignedByte", "xsd:unsignedByte", "xs:unsignedByte").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnsignedIntParser[uint8] }{ UnsignedIntParser[uint8]{}, }).Register()
var XSDUnsignedInt = ls.NewTerm(XSD, "unsignedInt", "xsd:unsignedInt", "xs:unsignedInt").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnsignedIntParser[uint32] }{ UnsignedIntParser[uint32]{}, }).Register()
var XSDUnsignedLong = ls.NewTerm(XSD, "unsignedLong", "xsd:unsignedLong", "xs:unsignedLong").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnsignedIntParser[uint64] }{ UnsignedIntParser[uint64]{}, }).Register()
var XSDUnsignedShort = ls.NewTerm(XSD, "unsignedShort", "xsd:unsignedShort", "xs:unsignedShort").SetComposition(ls.OverrideComposition).SetMetadata(struct { UnsignedIntParser[uint16] }{ UnsignedIntParser[uint16]{}, }).Register()
Functions ¶
func BuildMeasureNodes ¶
func BuildMeasureNodes(ctx *ls.Context, builder ls.GraphBuilder, measureSchemaNode *lpg.Node) error
BuildMeasureNode uses the measureSchemaNode to locate measure node instances in the graph, and creates/updates measure nodes in the graph. This function uses the measure service set in the context.
func BuildMeasureNodesForLayer ¶
BuildMeasureNodesForLayer builds all the measure nodes for the layer
func SetMeasureService ¶
func SetMeasureService(ctx *ls.Context, svc MeasureService)
SetMeasureService sets the measure service in context
func SetMeasureValue ¶
func SetMeasureValue(ctx *ls.Context, svc MeasureService, measureNode, schemaNode *lpg.Node, value Measure) error
SetMeasureValue sets the value of the measure node based on value. The schemaNode is used to collect measure annotations, and can be the same as the measure node, or can be nil. If nil, measure node itself will be used. The measure service will be used if the measure has to be converted to a different unit.
Types ¶
type DateTime ¶
type DateTime struct { Month int Day int Year int Nanoseconds int64 Milliseconds int64 Seconds int64 Minute int64 Hour int64 Location *time.Location }
func NewDateTime ¶
type DecimalParser ¶
type DecimalParser struct{}
func (DecimalParser) FormatNativeValue ¶
func (parser DecimalParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (DecimalParser) GetNativeValue ¶
func (DecimalParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
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 ErrMeasureProcessing ¶
func (ErrMeasureProcessing) Error ¶
func (e ErrMeasureProcessing) Error() string
type ErrMultipleNodesMatch ¶
type ErrMultipleNodesMatch struct {
Src string
}
func (ErrMultipleNodesMatch) Error ¶
func (e ErrMultipleNodesMatch) Error() string
type ErrNotAMeasure ¶
type ErrNotAMeasure struct {
Value string
}
func (ErrNotAMeasure) Error ¶
func (e ErrNotAMeasure) Error() string
type ErrOverflow ¶
func (ErrOverflow) Error ¶
func (o ErrOverflow) Error() string
type GYearMonth ¶
GYearMonth is XML Gregorian part of Year/Month
func (GYearMonth) String ¶
func (g GYearMonth) String() string
type JSONBooleanParser ¶
type JSONBooleanParser struct{}
func (JSONBooleanParser) FormatNativeValue ¶
func (JSONBooleanParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (JSONBooleanParser) GetNativeValue ¶
func (JSONBooleanParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type JSONDateParser ¶
type JSONDateParser struct{}
func (JSONDateParser) FormatNativeValue ¶
func (parser JSONDateParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
FormatNativeValue gets a target node and it's go native value, and returns the value of the target node to an JSONDate
func (JSONDateParser) GetNativeValue ¶
func (JSONDateParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
ParseValue parses a JSON date
YYYY-MM-DD
type JSONDateTimeParser ¶
type JSONDateTimeParser struct{}
func (JSONDateTimeParser) FormatNativeValue ¶
func (parser JSONDateTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
"2006-01-02T11:11:11Z07:00" -> Note: uses a 24Hour based clock "2006-01-02T11:11:11.999999999Z07:00"
func (JSONDateTimeParser) GetNativeValue ¶
func (JSONDateTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
ParseValue parses a JSON date-time
YYYY-MM-DD
type JSONNumberParser ¶
type JSONNumberParser struct{}
func (JSONNumberParser) FormatNativeValue ¶
func (parser JSONNumberParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (JSONNumberParser) GetNativeValue ¶
func (JSONNumberParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type JSONTimeParser ¶
type JSONTimeParser struct{}
func (JSONTimeParser) FormatNativeValue ¶
func (parser JSONTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (JSONTimeParser) GetNativeValue ¶
func (JSONTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
ParseValue parses a JSON time
HH:mm HH:mm:ss HH:mm:ssZ
type Measure ¶
type Measure struct { Value string `json:"value" yaml:"value"` Unit string `json:"unit" yaml:"unit"` }
Measure is the data type that contains a value and a unit
func ParseMeasure ¶
ParseMeasure parses a number and then a string for units
type MeasureService ¶
type MeasureService interface { // If the measure value does not include a spearate unit field, // then the field may be embedded into the value. This will parse // the embedded unit if possible and return it as a measure Parse(string) (Measure, error) // Convert a given measure into target unit if possible. Domain // may or may not be present, and may qualify the measure (such as // whether this is a height or weight, etc). Convert(measure Measure, targetUnit string, domain string) (Measure, error) }
MeasureService parses/validates/converts measures
func GetMeasureService ¶
func GetMeasureService(ctx *ls.Context) MeasureService
GetMeasureService returns the measure service set in the context. If there is none, returns defaultMeasureService
type PatternDateParser ¶
type PatternDateParser struct{}
func (PatternDateParser) FormatNativeValue ¶
func (parser PatternDateParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (PatternDateParser) GetNativeValue ¶
func (PatternDateParser) GetNativeValue(value string, node *lpg.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
type PatternDateTimeParser ¶
type PatternDateTimeParser struct{}
func (PatternDateTimeParser) FormatNativeValue ¶
func (parser PatternDateTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (PatternDateTimeParser) GetNativeValue ¶
func (PatternDateTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
GetNativeValue 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. If none existsm guesses format
type PatternTimeParser ¶
type PatternTimeParser struct{}
func (PatternTimeParser) FormatNativeValue ¶
func (parser PatternTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (PatternTimeParser) GetNativeValue ¶
func (PatternTimeParser) GetNativeValue(value string, node *lpg.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
type SignedIntParser ¶
type SignedIntParser[T signedInt] struct {
// contains filtered or unexported fields
}
func (SignedIntParser[T]) FormatNativeValue ¶
func (parser SignedIntParser[T]) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (SignedIntParser[T]) GetNativeValue ¶
func (SignedIntParser[T]) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type TimeOfDay ¶
type TimeOfDay struct { Nanoseconds int64 Milliseconds int64 Seconds int64 Minute int64 Hour int64 Location *time.Location }
func NewTimeOfDay ¶
type UnixTimeNano ¶
func (UnixTimeNano) String ¶
func (u UnixTimeNano) String() string
func (UnixTimeNano) ToTime ¶
func (u UnixTimeNano) ToTime() time.Time
type UnixTimeNanoParser ¶
type UnixTimeNanoParser struct{}
func (UnixTimeNanoParser) FormatNativeValue ¶
func (parser UnixTimeNanoParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (UnixTimeNanoParser) GetNativeValue ¶
func (UnixTimeNanoParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type UnixTimeParser ¶
type UnixTimeParser struct{}
func (UnixTimeParser) FormatNativeValue ¶
func (parser UnixTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (UnixTimeParser) GetNativeValue ¶
func (UnixTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type UnsignedIntParser ¶
type UnsignedIntParser[T unsignedInt] struct{}
func (UnsignedIntParser[T]) FormatNativeValue ¶
func (parser UnsignedIntParser[T]) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (UnsignedIntParser[T]) GetNativeValue ¶
func (UnsignedIntParser[T]) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XMLBooleanParser ¶
type XMLBooleanParser struct{}
func (XMLBooleanParser) FormatNativeValue ¶
func (XMLBooleanParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XMLBooleanParser) GetNativeValue ¶
func (XMLBooleanParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDDateParser ¶
type XSDDateParser struct{}
func (XSDDateParser) FormatNativeValue ¶
func (parser XSDDateParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
FormatNativeValue gets a target node and it's go native value, and returns the value of the target node to an XSDDate
func (XSDDateParser) GetNativeValue ¶
func (XSDDateParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
GetNativeValue parses an XSDDate value.
[-]CCYY-MM-DD[Z|(+|-)hh:mm]
type XSDDateTimeParser ¶
type XSDDateTimeParser struct{}
func (XSDDateTimeParser) FormatNativeValue ¶
func (parser XSDDateTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDDateTimeParser) GetNativeValue ¶
func (XSDDateTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDGDayParser ¶
type XSDGDayParser struct{}
func (XSDGDayParser) FormatNativeValue ¶
func (parser XSDGDayParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDGDayParser) GetNativeValue ¶
func (XSDGDayParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDGMonthDayParser ¶
type XSDGMonthDayParser struct{}
func (XSDGMonthDayParser) FormatNativeValue ¶
func (parser XSDGMonthDayParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDGMonthDayParser) GetNativeValue ¶
func (XSDGMonthDayParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDGMonthParser ¶
type XSDGMonthParser struct{}
func (XSDGMonthParser) FormatNativeValue ¶
func (parser XSDGMonthParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDGMonthParser) GetNativeValue ¶
func (XSDGMonthParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDGYearMonthParser ¶
type XSDGYearMonthParser struct{}
func (XSDGYearMonthParser) FormatNativeValue ¶
func (parser XSDGYearMonthParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDGYearMonthParser) GetNativeValue ¶
func (XSDGYearMonthParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDGYearParser ¶
type XSDGYearParser struct{}
func (XSDGYearParser) FormatNativeValue ¶
func (parser XSDGYearParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDGYearParser) GetNativeValue ¶
func (XSDGYearParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)
type XSDTimeParser ¶
type XSDTimeParser struct{}
func (XSDTimeParser) FormatNativeValue ¶
func (parser XSDTimeParser) FormatNativeValue(newValue, oldValue interface{}, node *lpg.Node) (string, error)
func (XSDTimeParser) GetNativeValue ¶
func (XSDTimeParser) GetNativeValue(value string, node *lpg.Node) (interface{}, error)