schema

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ComplexType1Type2AttrDefault      = "NonA"
	ComplexType1Type3AttrDefault      = "false"
	ComplexType1XferNumberAttrDefault = "30"
)

Functions

func CheckValidate

func CheckValidate(v interface{}) error

Types

type AdditionalField

type AdditionalField struct {
	xml.Attr
}

func (*AdditionalField) MarshalXMLAttr

func (a *AdditionalField) MarshalXMLAttr(_ xml.Name) (xml.Attr, error)

func (*AdditionalField) UnmarshalXMLAttr

func (a *AdditionalField) UnmarshalXMLAttr(attr xml.Attr) error

type AdditionalFields

type AdditionalFields struct {
	AdditionalFields AdditionalFieldsType `xml:",any,attr"`
	CustomElements   []AnyHolder          `xml:",any"`
}

type AdditionalFieldsType

type AdditionalFieldsType []AdditionalField

type AnyHolder

type AnyHolder struct {
	MModel
}

func (*AnyHolder) MarshalXML

func (a *AnyHolder) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*AnyHolder) UnmarshalXML

func (a *AnyHolder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ComplexType1

type ComplexType1 struct {
	NodeID
	Content        *TIEDNameOrNone `xml:",chardata" json:",omitempty"`
	TypeAttr       TAnyName        `xml:"type,attr" json:"type"`
	Type2Attr      *TIEDNameOrNone `xml:"type2,attr,omitempty" json:"type2,omitempty"`
	Type3Attr      *bool           `xml:"type3,attr,omitempty" json:"type3,omitempty"`
	XferNumberAttr *uint32         `xml:"xferNumber,attr,omitempty" json:"xferNumber,omitempty"`
}

"ComplexType" ComplexType1 ...

func (*ComplexType1) Validate

func (t *ComplexType1) Validate() error

Validate ...

type MModel

type MModel struct {
	XMLName xml.Name
	Attr    []xml.Attr `xml:",any,attr"`
	XML     string     `xml:",innerxml"`
}

type NodeID

type NodeID struct {
	NodeID *uuid.UUID `xml:"-" json:"node_id,omitempty"`
}

NodeID используется для маппинга элементов из бд и структуры

func (*NodeID) Read added in v1.0.3

func (t *NodeID) Read(el *Element) error

func (*NodeID) Scan added in v1.0.3

func (t *NodeID) Scan(el *Element) error

type SCL

type SCL struct {
	TBaseElement
	ComplexType1 []ComplexType1 `xml:"ComplexType1" json:"ComplexType1"`
}

"ComplexType" SCL ...

func (*SCL) Validate

func (t *SCL) Validate() error

Validate ...

type TAcsiName

type TAcsiName string

"SimpleType" base:"xs:Name" TAcsiName ...

func (*TAcsiName) String added in v1.0.3

func (t *TAcsiName) String() string

func (*TAcsiName) Validate

func (t *TAcsiName) Validate() error

Validate ...

type TAnyName

type TAnyName string

"SimpleType" base:"xs:normalizedString" TAnyName ...

func (*TAnyName) String added in v1.0.3

func (t *TAnyName) String() string

func (*TAnyName) Validate

func (t *TAnyName) Validate() error

Validate ...

type TBaseElement

type TBaseElement struct {
	NodeID
	AdditionalFields AdditionalFieldsType `xml:",any,attr" json:"-"`
	CustomElements   []AnyHolder          `xml:",any" json:"-"`
	Text             *string              `xml:"Text" json:"Text,omitempty"`
}

"Element"// "Element"// "ComplexType" TBaseElement ...

func (*TBaseElement) Validate

func (t *TBaseElement) Validate() error

Validate ...

type TIEDName

type TIEDName string

"SimpleType" base:"tAcsiName" TIEDName ...

func (*TIEDName) String added in v1.0.3

func (t *TIEDName) String() string

func (*TIEDName) Validate

func (t *TIEDName) Validate() error

Validate ...

type TIEDNameIsNone

type TIEDNameIsNone string

"SimpleType" base:"tAcsiName" TIEDNameIsNone ...

func (*TIEDNameIsNone) String added in v1.0.3

func (t *TIEDNameIsNone) String() string

func (*TIEDNameIsNone) Validate

func (t *TIEDNameIsNone) Validate() error

Validate ...

type TIEDNameOrNone

type TIEDNameOrNone struct {
	UnionContent
	// contains filtered or unexported fields
}

"SimpleType" TIEDNameOrNone is UNION type

func (*TIEDNameOrNone) IsEmpty

func (t *TIEDNameOrNone) IsEmpty() bool

func (*TIEDNameOrNone) MarshalXMLAttr

func (t *TIEDNameOrNone) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

func (*TIEDNameOrNone) UnmarshalXMLAttr

func (t *TIEDNameOrNone) UnmarshalXMLAttr(attr xml.Attr) error

func (*TIEDNameOrNone) Validate

func (t *TIEDNameOrNone) Validate() error

Validate ...

type UnionContent added in v1.0.2

type UnionContent struct {
	Content string `xml:",chardata" json:",omitempty"`
}

func (UnionContent) MarshalJSON added in v1.0.2

func (u UnionContent) MarshalJSON() ([]byte, error)

func (UnionContent) String added in v1.0.2

func (u UnionContent) String() string

func (*UnionContent) UnmarshalJSON added in v1.0.2

func (u *UnionContent) UnmarshalJSON(v []byte) error

type UnitSlice added in v1.0.3

type UnitSlice struct {
	NodeID
	Content string `xml:",chardata" json:",omitempty"`
}

"ComplexType" UnitSlice - хак чтобы побороть []uint32

func (*UnitSlice) CreateElement added in v1.0.3

func (t *UnitSlice) CreateElement(xmlTag string, level, pos uint, parentEl *Element) (*Element, error)

type UnsignedInt

type UnsignedInt string

func (*UnsignedInt) Validate

func (u *UnsignedInt) Validate() error

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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