schema

package
v0.0.0-...-adc0947 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package schema contains structs for reading xml definitions for ebml schema.

TODO: Generated from EBMLSchema.xsd.

Internal use only.

Index

Constants

This section is empty.

Variables

View Source
var (
	PurposeDefinition = "definition"
	PurposeRationale  = "rationale"
	PurposeReferences = "references"
	PurposeUsageNotes = "usage notes"
)
View Source
var (
	NoteAttributeMinOccurs = "minOccurs"
	NoteAttributeMaxOccurs = "maxOccurs"
	NoteAttributeRange     = "range"
	NoteAttributeLength    = "length"
	NoteAttributeDefault   = "default"
	NoteAttributeMinver    = "minver"
	NoteAttributeMaxver    = "maxver"
)
View Source
var (
	TypeInteger  = "integer"
	TypeUinteger = "uinteger"
	TypeFloat    = "float"
	TypeString   = "string"
	TypeDate     = "date"
	TypeUtf8     = "utf-8"
	TypeMaster   = "master"
	TypeBinary   = "binary"
)

Functions

func ResolveGoType

func ResolveGoType(s, name string) string

Types

type Documentation

type Documentation struct {
	Content string `xml:",chardata"`
	Lang    string `xml:"lang,attr"`
	Purpose string `xml:"purpose"`
}

type Element

type Element struct {
	Documentation      []Documentation `xml:"documentation"`
	ImplementationNote []Note          `xml:"implementation_note"`
	Restriction        *Restriction    `xml:"restriction"`
	Extension          []Extension     `xml:"extension"`

	Name               string       `xml:"name,attr"`
	Path               string       `xml:"path,attr"`
	ID                 ElementID    `xml:"id,attr"`
	MinOccurs          int          `xml:"minOccurs,attr"`
	MaxOccurs          UnboundedInt `xml:"maxOccurs,attr"`
	Range              string       `xml:"range,attr"`
	Length             string       `xml:"length,attr"`
	Default            *string      `xml:"default,attr"`
	Type               string       `xml:"type,attr"`
	UnknownSizeAllowed bool         `xml:"unknownsizeallowed,attr"`
	Recursive          bool         `xml:"recursive,attr"`
	Recurring          bool         `xml:"recurring,attr"`
	MinVer             int          `xml:"minver,attr"`
	MaxVer             int          `xml:"maxver,attr"`
}

func (*Element) UnmarshalXML

func (s *Element) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ElementID

type ElementID uint64

func (ElementID) String

func (h ElementID) String() string

func (*ElementID) UnmarshalXMLAttr

func (h *ElementID) UnmarshalXMLAttr(attr xml.Attr) error

type Enum

type Enum struct {
	Documentation []Documentation `xml:"documentation"`
	Label         string          `xml:"label,attr"`
	Value         string          `xml:"value,attr"`
}

type Extension

type Extension struct {
	Type       string     `xml:"type,attr"`
	Attributes []xml.Attr `xml:",any,attr"`
}

type Note

type Note struct {
	Content       string `xml:",chardata"`
	NoteAttribute string `xml:"note_attribute,attr"`
}

type Restriction

type Restriction struct {
	Enum []Enum `xml:"enum"`
}

type Schema

type Schema struct {
	Elements []Element `xml:"element"`

	DocType string `xml:"docType,attr"`
	Version int    `xml:"version,attr"`
	EBML    uint   `xml:"ebml,attr"`
}

type TreeNode

type TreeNode struct {
	El Element
	// contains filtered or unexported fields
}

func NewTreeNode

func NewTreeNode(el Element) *TreeNode

func (*TreeNode) Get

func (n *TreeNode) Get(key string) *TreeNode

func (*TreeNode) Put

func (n *TreeNode) Put(key string, el *TreeNode)

func (*TreeNode) VisitAll

func (n *TreeNode) VisitAll(f func(node *TreeNode))

type UnboundedInt

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

func (UnboundedInt) Unbounded

func (u UnboundedInt) Unbounded() bool

func (*UnboundedInt) UnmarshalXMLAttr

func (u *UnboundedInt) UnmarshalXMLAttr(attr xml.Attr) error

func (UnboundedInt) Val

func (u UnboundedInt) Val() int

Jump to

Keyboard shortcuts

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