document

package
v0.0.0-...-4158bf4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any interface {
	Type
}

func NewAny

func NewAny() Any

func NewRef

func NewRef(id string) Any

type Array

type Array interface {
	Type
	Element(e ...Type) Type
}

func NewArray

func NewArray(element Type) Array

type Bool

type Bool interface {
	Type
}

func NewBool

func NewBool() Bool

type DeclaredType

type DeclaredType interface {
	Type
	Id() string
	Type() Type
}

func NewDeclaredType

func NewDeclaredType(id string, t Type) DeclaredType

type Document

type Document struct {
	Comments []string
	Package  string
	Types    map[string]DeclaredType
}

func NewDocument

func NewDocument(packageName string, comments ...string) *Document

func (*Document) GetDeclaredType

func (d *Document) GetDeclaredType(id string) (t DeclaredType, ok bool)

func (*Document) PutDeclaredType

func (d *Document) PutDeclaredType(t DeclaredType, merge bool)

func (*Document) String

func (d *Document) String() string

type Field

type Field struct {
	Name string
	Type Type

	// Json tag params
	Key       string
	OmitEmpty bool
}

func (*Field) Options

func (f *Field) Options() string

func (*Field) String

func (f *Field) String() string

type Float

type Float interface {
	Type
}

func NewFloat

func NewFloat() Float

type Int

type Int interface {
	Type
}

func NewInt

func NewInt() Int

type Map

type Map interface {
	Type
	Key(k ...Type) Type
	Value(v ...Type) Type
}

func NewMap

func NewMap(key, value Type) Map

type Ref

type Ref interface {
	Type
	Id() string
}

type String

type String interface {
	Type
}

func NewString

func NewString() String

type Struct

type Struct interface {
	Type

	Set(field *Field) Struct
	Get(key string) (*Field, bool)
	Fields() []*Field
	Keys() []string
	Len() int
}

func NewStruct

func NewStruct() Struct

type Type

type Type interface {
	fmt.Stringer
	Nullable(v ...bool) Type
	IsNullable() bool
}

Jump to

Keyboard shortcuts

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