Documentation ¶
Overview ¶
A tiny package imported by all "go-xsd"-generated packages.
Maps all XSD built-in simple-types to Go types, which affords us easy mapping of any XSD type references in the schema to Go imports: every xs:string and xs:boolean automatically becomes xsdt.String and xsdt.Boolean etc. Types are mapped to Go types depending on how encoding/xml.Unmarshal() can handle them: ie. it parses bools and numbers, but dates/durations have too many format mismatches and thus are just declared string types. Same for base64- and hex-encoded binary data: since Unmarshal() won't decode them, we leave them as strings. If you need their binary data, your code needs to import Go's base64/hex codec packages and use them as necessary.
Index ¶
- func ListValues(v string) (spl []string)
- func ListValuesBoolean(vals []Boolean) (sl []bool)
- func ListValuesDouble(vals []Double) (sl []float64)
- func ListValuesLong(vals []Long) (sl []int64)
- func OnWalkError(err *error, slice *[]error, breakWalk bool, handler func(error)) (ret bool)
- type AnySimpleType
- type AnyType
- type AnyURI
- type Base64Binary
- type Boolean
- type Byte
- type Date
- type DateTime
- type Decimal
- type Double
- type Duration
- type Entities
- type Entity
- type Float
- type GDay
- type GMonth
- type GMonthDay
- type GYear
- type GYearMonth
- type HexBinary
- type Id
- type Idref
- type Idrefs
- type Int
- type Integer
- type Language
- type Long
- type NCName
- type Name
- type NegativeInteger
- type Nmtoken
- type Nmtokens
- type NonNegativeInteger
- type NonPositiveInteger
- type NormalizedString
- type Notation
- type Notations
- type PositiveInteger
- type Qname
- type Short
- type String
- type Time
- type ToXsdtAnySimpleType
- type ToXsdtAnyType
- type ToXsdtAnyURI
- type ToXsdtBase64Binary
- type ToXsdtBoolean
- type ToXsdtByte
- type ToXsdtDate
- type ToXsdtDateTime
- type ToXsdtDecimal
- type ToXsdtDouble
- type ToXsdtDuration
- type ToXsdtEntities
- type ToXsdtEntity
- type ToXsdtFloat
- type ToXsdtGDay
- type ToXsdtGMonth
- type ToXsdtGMonthDay
- type ToXsdtGYear
- type ToXsdtGYearMonth
- type ToXsdtHexBinary
- type ToXsdtId
- type ToXsdtIdref
- type ToXsdtIdrefs
- type ToXsdtInt
- type ToXsdtInteger
- type ToXsdtLanguage
- type ToXsdtLong
- type ToXsdtNCName
- type ToXsdtName
- type ToXsdtNegativeInteger
- type ToXsdtNmtoken
- type ToXsdtNmtokens
- type ToXsdtNonNegativeInteger
- type ToXsdtNonPositiveInteger
- type ToXsdtNormalizedString
- type ToXsdtNotation
- type ToXsdtPositiveInteger
- type ToXsdtQname
- type ToXsdtShort
- type ToXsdtString
- type ToXsdtTime
- type ToXsdtToken
- type ToXsdtUnsignedByte
- type ToXsdtUnsignedInt
- type ToXsdtUnsignedLong
- type ToXsdtUnsignedShort
- type Token
- type UnsignedByte
- type UnsignedInt
- type UnsignedLong
- type UnsignedShort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListValues ¶
XSD "list" types are always space-separated strings. All generated Go types based on any XSD's list types get a Values() method, which will always resort to this function.
func ListValuesBoolean ¶
func ListValuesDouble ¶
func ListValuesLong ¶
Types ¶
type AnySimpleType ¶
type AnySimpleType string
In XSD, the type xsd:anySimpleType is the base type from which all other built-in types are derived.
func (*AnySimpleType) Set ¶
func (me *AnySimpleType) Set(v string)
Since this is just a simple String type, this merely sets the current value from the specified string.
func (AnySimpleType) String ¶
func (me AnySimpleType) String() string
Since this is just a simple String type, this merely returns its current string value.
type AnyType ¶
type AnyType string
In XSD, represents any simple or complex type. In Go, we hope no one schema ever uses it.
type AnyURI ¶
type AnyURI string
Represents a URI as defined by RFC 2396. An anyURI value can be absolute or relative, and may have an optional fragment identifier.
type Base64Binary ¶
type Base64Binary string // []byte
Represents Base64-encoded arbitrary binary data. A base64Binary is the set of finite-length sequences of binary octets.
func (*Base64Binary) Set ¶
func (me *Base64Binary) Set(v string)
Since this is just a simple String type, this merely sets the current value from the specified string.
func (Base64Binary) String ¶
func (me Base64Binary) String() string
Since this is just a simple String type, this merely returns its current string value.
type Boolean ¶
type Boolean bool
Represents Boolean values, which are either true or false.
type Byte ¶
type Byte int8
Represents an integer with a minimum value of -128 and maximum of 127.
type Date ¶
type Date string // time.Time
Represents a calendar date. The pattern for date is CCYY-MM-DD with optional time zone indicator as allowed for dateTime.
type DateTime ¶
type DateTime string // time.Time
Represents a specific instance of time.
type Decimal ¶
type Decimal string // complex128
Represents arbitrary precision numbers.
type Double ¶
type Double float64
Represents double-precision 64-bit floating-point numbers.
type Duration ¶
type Duration string // time.Duration
Represents a duration of time.
type Entities ¶
type Entities string
Represents the ENTITIES attribute type. Contains a set of values of type ENTITY.
func (*Entities) Set ¶
Since this is just a simple String type, this merely sets the current value from the specified string.
type Entity ¶
type Entity NCName
This is a reference to an unparsed entity with a name that matches the specified name.
type Float ¶
type Float float32
Represents single-precision 32-bit floating-point numbers.
type GDay ¶
type GDay string
Represents a Gregorian day that recurs, specifically a day of the month such as the fifth day of the month. A gDay is the space of a set of calendar dates. Specifically, it is a set of one-day long, monthly periodic instances.
type GMonth ¶
type GMonth string
Represents a Gregorian month that recurs every year. A gMonth is the space of a set of calendar months. Specifically, it is a set of one-month long, yearly periodic instances.
type GMonthDay ¶
type GMonthDay string
Represents a specific Gregorian date that recurs, specifically a day of the year such as the third of May. A gMonthDay is the set of calendar dates. Specifically, it is a set of one-day long, annually periodic instances.
type GYear ¶
type GYear string
Represents a Gregorian year. A set of one-year long, nonperiodic instances.
type GYearMonth ¶
type GYearMonth string
Represents a specific Gregorian month in a specific Gregorian year. A set of one-month long, nonperiodic instances.
func (*GYearMonth) Set ¶
func (me *GYearMonth) Set(v string)
Since this is just a simple String type, this merely sets the current value from the specified string.
func (GYearMonth) String ¶
func (me GYearMonth) String() string
Since this is just a simple String type, this merely returns its current string value.
type HexBinary ¶
type HexBinary string // []byte
Represents arbitrary hex-encoded binary data. A hexBinary is the set of finite-length sequences of binary octets. Each binary octet is encoded as a character tuple, consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code.
type Id ¶
type Id NCName
The ID must be a no-colon-name (NCName) and must be unique within an XML document.
type Idref ¶
type Idref NCName
Represents a reference to an element that has an ID attribute that matches the specified ID. An IDREF must be an NCName and must be a value of an element or attribute of type ID within the XML document.
type Idrefs ¶
type Idrefs string
Contains a set of values of type IDREF.
func (*Idrefs) Set ¶
Since this is just a simple String type, this merely sets the current value from the specified string.
type Int ¶
type Int int32
Represents an integer with a minimum value of -2147483648 and maximum of 2147483647.
type Integer ¶
type Integer int64
Represents a sequence of decimal digits with an optional leading sign (+ or -).
type Language ¶
type Language Token
Represents natural language identifiers (defined by RFC 1766).
type Long ¶
type Long int64
Represents an integer with a minimum value of -9223372036854775808 and maximum of 9223372036854775807.
type NCName ¶
type NCName Name
Represents noncolonized names. This data type is the same as Name, except it cannot begin with a colon.
type Name ¶
type Name Token
Represents names in XML. A Name is a token that begins with a letter, underscore, or colon and continues with name characters (letters, digits, and other characters).
type NegativeInteger ¶
type NegativeInteger int64
Represents an integer that is less than zero. Consists of a negative sign (-) and sequence of decimal digits.
func (NegativeInteger) N ¶
func (me NegativeInteger) N() int64
Because littering your code with type conversions is a hassle...
func (*NegativeInteger) Set ¶
func (me *NegativeInteger) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (NegativeInteger) String ¶
func (me NegativeInteger) String() string
Returns a string representation of its current non-string scalar value.
type Nmtoken ¶
type Nmtoken Token
An NMTOKEN is set of name characters (letters, digits, and other characters) in any combination. Unlike Name and NCName, NMTOKEN has no restrictions on the starting character.
type Nmtokens ¶
type Nmtokens string
Contains a set of values of type NMTOKEN.
func (*Nmtokens) Set ¶
Since this is just a simple String type, this merely sets the current value from the specified string.
type NonNegativeInteger ¶
type NonNegativeInteger uint64
Represents an integer that is greater than or equal to zero.
func (NonNegativeInteger) N ¶
func (me NonNegativeInteger) N() uint64
Because littering your code with type conversions is a hassle...
func (*NonNegativeInteger) Set ¶
func (me *NonNegativeInteger) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (NonNegativeInteger) String ¶
func (me NonNegativeInteger) String() string
Returns a string representation of its current non-string scalar value.
type NonPositiveInteger ¶
type NonPositiveInteger int64
Represents an integer that is less than or equal to zero. A nonPositiveIntegerconsists of a negative sign (-) and sequence of decimal digits.
func (NonPositiveInteger) N ¶
func (me NonPositiveInteger) N() int64
Because littering your code with type conversions is a hassle...
func (*NonPositiveInteger) Set ¶
func (me *NonPositiveInteger) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (NonPositiveInteger) String ¶
func (me NonPositiveInteger) String() string
Returns a string representation of its current non-string scalar value.
type NormalizedString ¶
type NormalizedString String
Represents white space normalized strings.
func (*NormalizedString) Set ¶
func (me *NormalizedString) Set(v string)
Since this is just a simple String type, this merely sets the current value from the specified string.
func (NormalizedString) String ¶
func (me NormalizedString) String() string
Since this is just a simple String type, this merely returns its current string value.
type Notation ¶
type Notation string
A set of QNames.
func (*Notation) Set ¶
Since this is just a simple String type, this merely sets the current value from the specified string.
type PositiveInteger ¶
type PositiveInteger uint64
Represents an integer that is greater than zero.
func (PositiveInteger) N ¶
func (me PositiveInteger) N() uint64
Because littering your code with type conversions is a hassle...
func (*PositiveInteger) Set ¶
func (me *PositiveInteger) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (PositiveInteger) String ¶
func (me PositiveInteger) String() string
Returns a string representation of its current non-string scalar value.
type Qname ¶
type Qname string
Represents a qualified name. A qualified name is composed of a prefix and a local name separated by a colon. Both the prefix and local names must be an NCName. The prefix must be associated with a namespace URI reference, using a namespace declaration.
type Short ¶
type Short int16
Represents an integer with a minimum value of -32768 and maximum of 32767.
type String ¶
type String string
Represents character strings.
type Time ¶
type Time string // time.Time
Represents a specific instance of time.
type ToXsdtAnySimpleType ¶
type ToXsdtAnySimpleType interface {
ToXsdtAnySimpleType() AnySimpleType
}
A convenience interface that declares a type conversion to AnySimpleType.
type ToXsdtAnyType ¶
type ToXsdtAnyType interface {
ToXsdtAnyType() AnyType
}
A convenience interface that declares a type conversion to AnyType.
type ToXsdtAnyURI ¶
type ToXsdtAnyURI interface {
ToXsdtAnyURI() AnyURI
}
A convenience interface that declares a type conversion to AnyURI.
type ToXsdtBase64Binary ¶
type ToXsdtBase64Binary interface {
ToXsdtBase64Binary() Base64Binary
}
A convenience interface that declares a type conversion to Base64Binary.
type ToXsdtBoolean ¶
type ToXsdtBoolean interface {
ToXsdtBoolean() Boolean
}
A convenience interface that declares a type conversion to Boolean.
type ToXsdtByte ¶
type ToXsdtByte interface {
ToXsdtByte() Byte
}
A convenience interface that declares a type conversion to Byte.
type ToXsdtDate ¶
type ToXsdtDate interface {
ToXsdtDate() Date
}
A convenience interface that declares a type conversion to Date.
type ToXsdtDateTime ¶
type ToXsdtDateTime interface {
ToXsdtDateTime() DateTime
}
A convenience interface that declares a type conversion to DateTime.
type ToXsdtDecimal ¶
type ToXsdtDecimal interface {
ToXsdtDecimal() Decimal
}
A convenience interface that declares a type conversion to Decimal.
type ToXsdtDouble ¶
type ToXsdtDouble interface {
ToXsdtDouble() Double
}
A convenience interface that declares a type conversion to Double.
type ToXsdtDuration ¶
type ToXsdtDuration interface {
ToXsdtDuration() Duration
}
A convenience interface that declares a type conversion to Duration.
type ToXsdtEntities ¶
type ToXsdtEntities interface {
ToXsdtEntities() Entities
}
A convenience interface that declares a type conversion to Entities.
type ToXsdtEntity ¶
type ToXsdtEntity interface {
ToXsdtEntity() Entity
}
A convenience interface that declares a type conversion to Entity.
type ToXsdtFloat ¶
type ToXsdtFloat interface {
ToXsdtFloat() Float
}
A convenience interface that declares a type conversion to Float.
type ToXsdtGDay ¶
type ToXsdtGDay interface {
ToXsdtGDay() GDay
}
A convenience interface that declares a type conversion to GDay.
type ToXsdtGMonth ¶
type ToXsdtGMonth interface {
ToXsdtGMonth() GMonth
}
A convenience interface that declares a type conversion to GMonth.
type ToXsdtGMonthDay ¶
type ToXsdtGMonthDay interface {
ToXsdtGMonthDay() GMonthDay
}
A convenience interface that declares a type conversion to GMonthDay.
type ToXsdtGYear ¶
type ToXsdtGYear interface {
ToXsdtGYear() GYear
}
A convenience interface that declares a type conversion to GYear.
type ToXsdtGYearMonth ¶
type ToXsdtGYearMonth interface {
ToXsdtGYearMonth() GYearMonth
}
A convenience interface that declares a type conversion to GYearMonth.
type ToXsdtHexBinary ¶
type ToXsdtHexBinary interface {
ToXsdtHexBinary() HexBinary
}
A convenience interface that declares a type conversion to HexBinary.
type ToXsdtId ¶
type ToXsdtId interface {
ToXsdtId() Id
}
A convenience interface that declares a type conversion to Id.
type ToXsdtIdref ¶
type ToXsdtIdref interface {
ToXsdtIdref() Idref
}
A convenience interface that declares a type conversion to Idref.
type ToXsdtIdrefs ¶
type ToXsdtIdrefs interface {
ToXsdtIdrefs() Idrefs
}
A convenience interface that declares a type conversion to Idrefs.
type ToXsdtInt ¶
type ToXsdtInt interface {
ToXsdtInt() Int
}
A convenience interface that declares a type conversion to Int.
type ToXsdtInteger ¶
type ToXsdtInteger interface {
ToXsdtInteger() Integer
}
A convenience interface that declares a type conversion to Integer.
type ToXsdtLanguage ¶
type ToXsdtLanguage interface {
ToXsdtLanguage() Language
}
A convenience interface that declares a type conversion to Language.
type ToXsdtLong ¶
type ToXsdtLong interface {
ToXsdtLong() Long
}
A convenience interface that declares a type conversion to Long.
type ToXsdtNCName ¶
type ToXsdtNCName interface {
ToXsdtNCName() NCName
}
A convenience interface that declares a type conversion to NCName.
type ToXsdtName ¶
type ToXsdtName interface {
ToXsdtName() Name
}
A convenience interface that declares a type conversion to Name.
type ToXsdtNegativeInteger ¶
type ToXsdtNegativeInteger interface {
ToXsdtNegativeInteger() NegativeInteger
}
A convenience interface that declares a type conversion to NegativeInteger.
type ToXsdtNmtoken ¶
type ToXsdtNmtoken interface {
ToXsdtNmtoken() Nmtoken
}
A convenience interface that declares a type conversion to Nmtoken.
type ToXsdtNmtokens ¶
type ToXsdtNmtokens interface {
ToXsdtNmtokens() Nmtokens
}
A convenience interface that declares a type conversion to Nmtokens.
type ToXsdtNonNegativeInteger ¶
type ToXsdtNonNegativeInteger interface {
ToXsdtNonNegativeInteger() NonNegativeInteger
}
A convenience interface that declares a type conversion to NonNegativeInteger.
type ToXsdtNonPositiveInteger ¶
type ToXsdtNonPositiveInteger interface {
ToXsdtNonPositiveInteger() NonPositiveInteger
}
A convenience interface that declares a type conversion to NonPositiveInteger.
type ToXsdtNormalizedString ¶
type ToXsdtNormalizedString interface {
ToXsdtNormalizedS() NormalizedString
}
A convenience interface that declares a type conversion to NormalizedString.
type ToXsdtNotation ¶
type ToXsdtNotation interface {
ToXsdtNotation() Notation
}
A convenience interface that declares a type conversion to Notation.
type ToXsdtPositiveInteger ¶
type ToXsdtPositiveInteger interface {
ToXsdtPositiveInteger() PositiveInteger
}
A convenience interface that declares a type conversion to PositiveInteger.
type ToXsdtQname ¶
type ToXsdtQname interface {
ToXsdtQname() Qname
}
A convenience interface that declares a type conversion to Qname.
type ToXsdtShort ¶
type ToXsdtShort interface {
ToXsdtShort() Short
}
A convenience interface that declares a type conversion to Short.
type ToXsdtString ¶
type ToXsdtString interface {
ToXsdtString() String
}
A convenience interface that declares a type conversion to String.
type ToXsdtTime ¶
type ToXsdtTime interface {
ToXsdtTime() Time
}
A convenience interface that declares a type conversion to Time.
type ToXsdtToken ¶
type ToXsdtToken interface {
ToXsdtToken() Token
}
A convenience interface that declares a type conversion to Token.
type ToXsdtUnsignedByte ¶
type ToXsdtUnsignedByte interface {
ToXsdtUnsignedByte() UnsignedByte
}
A convenience interface that declares a type conversion to UnsignedByte.
type ToXsdtUnsignedInt ¶
type ToXsdtUnsignedInt interface {
ToXsdtUnsignedInt() UnsignedInt
}
A convenience interface that declares a type conversion to UnsignedInt.
type ToXsdtUnsignedLong ¶
type ToXsdtUnsignedLong interface {
ToXsdtUnsignedLong() UnsignedLong
}
A convenience interface that declares a type conversion to UnsignedLong.
type ToXsdtUnsignedShort ¶
type ToXsdtUnsignedShort interface {
ToXsdtUnsignedShort() UnsignedShort
}
A convenience interface that declares a type conversion to UnsignedShort.
type Token ¶
type Token NormalizedString
Represents tokenized strings.
type UnsignedByte ¶
type UnsignedByte uint8
Represents an integer with a minimum of zero and maximum of 255.
func (UnsignedByte) N ¶
func (me UnsignedByte) N() uint8
Because littering your code with type conversions is a hassle...
func (*UnsignedByte) Set ¶
func (me *UnsignedByte) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (UnsignedByte) String ¶
func (me UnsignedByte) String() string
Returns a string representation of its current non-string scalar value.
type UnsignedInt ¶
type UnsignedInt uint32
Represents an integer with a minimum of zero and maximum of 4294967295.
func (UnsignedInt) N ¶
func (me UnsignedInt) N() uint32
Because littering your code with type conversions is a hassle...
func (*UnsignedInt) Set ¶
func (me *UnsignedInt) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (UnsignedInt) String ¶
func (me UnsignedInt) String() string
Returns a string representation of its current non-string scalar value.
type UnsignedLong ¶
type UnsignedLong uint64
Represents an integer with a minimum of zero and maximum of 18446744073709551615.
func (UnsignedLong) N ¶
func (me UnsignedLong) N() uint64
Because littering your code with type conversions is a hassle...
func (*UnsignedLong) Set ¶
func (me *UnsignedLong) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (UnsignedLong) String ¶
func (me UnsignedLong) String() string
Returns a string representation of its current non-string scalar value.
type UnsignedShort ¶
type UnsignedShort uint16
Represents an integer with a minimum of zero and maximum of 65535.
func (UnsignedShort) N ¶
func (me UnsignedShort) N() uint16
Because littering your code with type conversions is a hassle...
func (*UnsignedShort) Set ¶
func (me *UnsignedShort) Set(s string)
Since this is a non-string scalar type, sets its current value obtained from parsing the specified string.
func (UnsignedShort) String ¶
func (me UnsignedShort) String() string
Returns a string representation of its current non-string scalar value.