container

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Name    string     `json:"name,omitempty"`
	Entries []*Entry   `json:"entries,omitempty"`
	Prev    *Container `json:"prev,omitempty"`
}

func NewContainer

func NewContainer(n string, prev *Container, opts ...ContainerOption) *Container

func (*Container) GetFullName

func (c *Container) GetFullName() string

type ContainerOption

type ContainerOption func(c *Container)

type Entry

type Entry struct {
	Next          *Container `json:"prev,omitempty"`
	Prev          *Container `json:"next,omitempty"`
	Name          string     `json:"name,omitempty"`
	Type          string     `json:"type,omitempty"`
	Enum          []string   `json:"enum,omitempty"`
	EnumString    string     `json:"enumString,omitempty"`
	Range         []int      `json:"range,omitempty"`
	Length        []int      `json:"length,omitempty"`
	Pattern       []string   `json:"pattern,omitempty"`
	PatternString string     `json:"patternString,omitempty"`
	Union         bool       `json:"union,omitempty"`
	Mandatory     bool       `json:"mandatory,omitempty"`
	Default       string     `json:"default,omitempty"`
	Key           string     `json:"key,omitempty"`
}

Entry structure keeps track of the elements in a struct/list

func NewEntry

func NewEntry(n string, opts ...EntryOption) *Entry

func (*Entry) GetKey

func (e *Entry) GetKey() string

func (*Entry) GetName

func (e *Entry) GetName() string

func (*Entry) GetType

func (e *Entry) GetType() string

type EntryOption

type EntryOption func(c *Entry)

Option can be used to manipulate Options.

func WithDefault

func WithDefault(s string) EntryOption

func WithEnum

func WithEnum(s []string) EntryOption

func WithLength

func WithLength(s []int) EntryOption

func WithMandatory

func WithMandatory(b bool) EntryOption

func WithPattern

func WithPattern(s []string) EntryOption

func WithRange

func WithRange(s []int) EntryOption

func WithType

func WithType(s string) EntryOption

func WithUnion

func WithUnion(b bool) EntryOption

Jump to

Keyboard shortcuts

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