types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const JSON = "https://json-schema.org/"
View Source
const Unix = "https://unixtime.org/"
View Source
const XSD = "http://www.w3.org/2001/XMLSchema/"

Variables

View Source
var GoTimeFormatTerm = ls.NewTerm(ls.LS, "goTimeFormat", "ls:goTimeFormat").SetComposition(ls.SetComposition).Register()
View Source
var JSONBooleanTerm = ls.NewTerm(JSON, "boolean", "json:boolean").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	JSONBooleanParser
}{
	JSONBooleanParser{},
}).Register()
View Source
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
View Source
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

View Source
var JSONInteger = ls.NewTerm(JSON, "integer", "json:integer").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int8]
}{
	SignedIntParser[int8]{},
}).Register()
View Source
var JSONNumber = ls.NewTerm(JSON, "number", "json:number").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	JSONNumberParser
}{
	JSONNumberParser{},
}).Register()
View Source
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
View Source
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

View Source
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

View Source
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

View Source
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

View Source
var MeasureUnitTerm = ls.NewTerm(ls.LS, "measure/unit").SetComposition(ls.OverrideComposition).Register()

MeasureUnitTerm is a node property term giving measure unit

View Source
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

View Source
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

View Source
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.

View Source
var MeasureValueTerm = ls.NewTerm(ls.LS, "measure/value").SetComposition(ls.OverrideComposition).Register()

MeasureValueTerm is a node property term giving measure value.

View Source
var MomentTimeFormatTerm = ls.NewTerm(ls.LS, "momentTimeFormat", "ls:momentTimeFormat").SetComposition(ls.SetComposition).Register()
View Source
var PatternDateTerm = ls.NewTerm(ls.LS, "date", "ls:date").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	PatternDateParser
}{
	PatternDateParser: PatternDateParser{},
}).Register()
View Source
var PatternDateTimeTerm = ls.NewTerm(ls.LS, "dateTime", "ls:dateTime").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	PatternDateTimeParser
}{
	PatternDateTimeParser: PatternDateTimeParser{},
}).Register()
View Source
var PatternTimeTerm = ls.NewTerm(ls.LS, "time", "ls:time").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	PatternTimeParser
}{
	PatternTimeParser: PatternTimeParser{},
}).Register()
View Source
var UnixTimeNanoTerm = ls.NewTerm(Unix, "timeNano", "unix:timeNano").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	UnixTimeNanoParser
}{
	UnixTimeNanoParser: UnixTimeNanoParser{},
}).Register()
View Source
var UnixTimeTerm = ls.NewTerm(Unix, "time", "unix:time").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	UnixTimeParser
}{
	UnixTimeParser: UnixTimeParser{},
}).Register()
View Source
var XMLBooleanTerm = ls.NewTerm(XSD, "boolean", "xsd:boolean", "xs:boolean").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	XMLBooleanParser
}{
	XMLBooleanParser{},
}).Register()
View Source
var XSDByte = ls.NewTerm(XSD, "byte", "xsd:byte", "xs:byte").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int8]
}{
	SignedIntParser[int8]{},
}).Register()
View Source
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]
View Source
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

View Source
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()
View Source
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)

View Source
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

View Source
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)

View Source
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

View Source
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)

View Source
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()
View Source
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()
View Source
var XSDNegativeInteger = ls.NewTerm(XSD, "negativeInteger", "xsd:negativeInteger", "xs:negativeInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int64]
}{
	SignedIntParser[int64]{
		max: &negativeOne64,
	},
}).Register()
View Source
var XSDNonNegativeInteger = ls.NewTerm(XSD, "nonNegativeInteger", "xsd:nonNegativeInteger", "xs:nonNegativeInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int64]
}{
	SignedIntParser[int64]{
		min: &zero64,
	},
}).Register()
View Source
var XSDNonPositiverInteger = ls.NewTerm(XSD, "nonPositiveInteger", "xsd:nonPositiveInteger", "xs:nonPositiveInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int64]
}{
	SignedIntParser[int64]{
		max: &zero64,
	},
}).Register()
View Source
var XSDPositiveInteger = ls.NewTerm(XSD, "positiveInteger", "xsd:positiveInteger", "xs:positiveInteger").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int64]
}{
	SignedIntParser[int64]{
		min: &one64,
	},
}).Register()
View Source
var XSDShort = ls.NewTerm(XSD, "short", "xsd:short", "xs:short").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	SignedIntParser[int16]
}{
	SignedIntParser[int16]{},
}).Register()
View Source
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.

View Source
var XSDUnsignedByte = ls.NewTerm(XSD, "unsignedByte", "xsd:unsignedByte", "xs:unsignedByte").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	UnsignedIntParser[uint8]
}{
	UnsignedIntParser[uint8]{},
}).Register()
View Source
var XSDUnsignedInt = ls.NewTerm(XSD, "unsignedInt", "xsd:unsignedInt", "xs:unsignedInt").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	UnsignedIntParser[uint32]
}{
	UnsignedIntParser[uint32]{},
}).Register()
View Source
var XSDUnsignedLong = ls.NewTerm(XSD, "unsignedLong", "xsd:unsignedLong", "xs:unsignedLong").SetComposition(ls.OverrideComposition).SetMetadata(struct {
	UnsignedIntParser[uint64]
}{
	UnsignedIntParser[uint64]{},
}).Register()
View Source
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

func BuildMeasureNodesForLayer(ctx *ls.Context, bldr ls.GraphBuilder, layer *ls.Layer) error

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.

func ToGomentTime

func ToGomentTime(time time.Time) (*goment.Goment, error)

try to convert to go native time with function ToGoTime then pass result as parameter

Types

type Date

type Date struct {
	Month    int
	Day      int
	Year     int
	Location *time.Location
}

func NewDate

func NewDate(t time.Time) Date

func (Date) String

func (d Date) String() string

func (Date) ToTime

func (d Date) ToTime() time.Time

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

func NewDateTime(t time.Time) DateTime

func (DateTime) String

func (dt DateTime) String() string

func (DateTime) ToTime

func (dt DateTime) ToTime() time.Time

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

type ErrIncompatibleTypes

type ErrIncompatibleTypes struct {
	// contains filtered or unexported fields
}

func (ErrIncompatibleTypes) Error

func (e ErrIncompatibleTypes) Error() string

type ErrMeasureProcessing

type ErrMeasureProcessing struct {
	Msg string
	ID  string
}

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

type ErrOverflow struct {
	NodeID string
	Type   string
	Value  interface{}
}

func (ErrOverflow) Error

func (o ErrOverflow) Error() string

type GDay

type GDay int

GDay is XML Gregorian day part of date

func (GDay) String

func (g GDay) String() string

type GMonth

type GMonth int

GMonth is XML Gregorian month part of date

func (GMonth) String

func (g GMonth) String() string

type GMonthDay

type GMonthDay struct {
	Day   int
	Month int
}

GMonthDay is XML Gregorian part of Month/Day

func (GMonthDay) String

func (g GMonthDay) String() string

type GYear

type GYear int

GMonth is XML Gregorian year part of date

func (GYear) String

func (g GYear) String() string

type GYearMonth

type GYearMonth struct {
	Year  int
	Month int
}

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

func ParseMeasure(in string) (Measure, error)

ParseMeasure parses a number and then a string for units

func (Measure) String

func (m Measure) String() string

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

func NewTimeOfDay(t time.Time) TimeOfDay

func (TimeOfDay) String

func (t TimeOfDay) String() string

func (TimeOfDay) ToTime

func (t TimeOfDay) ToTime() time.Time

type UnixTime

type UnixTime struct {
	Seconds  int64
	Location *time.Location
}

func (UnixTime) String

func (u UnixTime) String() string

func (UnixTime) ToTime

func (u UnixTime) ToTime() time.Time

type UnixTimeNano

type UnixTimeNano struct {
	Nanoseconds int64
	Location    *time.Location
}

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)

Jump to

Keyboard shortcuts

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