tree

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tree contains a bunch of awful code that transforms the XSD into an internal representation that we can then template into Go code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllElems

func AllElems(cts xsd.ComplexType) []xsd.Element

func DocString

func DocString(doc xsd.Documentation) string

Types

type Node

type Node struct {
	Name          string
	Type          Type
	Nodes         []*Node
	Multiple      bool
	Attr          bool
	Documentation []string
	IsBase        bool
}

func AttrToNode

func AttrToNode(attr xsd.Attribute) *Node

func ElemToNode

func ElemToNode(elem xsd.Element) (*Node, bool)

func (*Node) InternalRender

func (n *Node) InternalRender(w io.Writer)

func (*Node) InternalRenderAttr

func (n *Node) InternalRenderAttr(w io.Writer)

func (*Node) InternalRenderField

func (n *Node) InternalRenderField(w io.Writer)

func (*Node) PublicRender

func (n *Node) PublicRender(w io.Writer, name string)

func (*Node) PublicRenderEnum added in v0.7.1

func (n *Node) PublicRenderEnum(w io.Writer)

func (*Node) PublicRenderMethod

func (n *Node) PublicRenderMethod(w io.Writer, name string)

func (*Node) ResolveType

func (n *Node) ResolveType(tm TypeMap)

type Root

type Root struct {
	Meta meta.Data

	Nodes   []*Node
	Imports []string
}

func WalkXSD

func WalkXSD(schema *xsd.Schema) *Root

func (*Root) InternalTemplate

func (r *Root) InternalTemplate(w io.Writer)

func (*Root) PublicTemplate

func (r *Root) PublicTemplate(w io.Writer)

type Type

type Type struct {
	Kind      string
	Final     bool
	Choices   []string
	Undertype string
}

type TypeMap

type TypeMap struct {
	Types    map[string]*Node
	Bases    map[string]struct{}
	Aliasses map[string]string
}

Jump to

Keyboard shortcuts

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