base

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 6 Imported by: 22 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ExamplesLabel = "examples"
	ExampleLabel  = "example"
	ValueLabel    = "value"
)
View Source
const (
	InfoLabel    = "info"
	ContactLabel = "contact"
	LicenseLabel = "license"
)
View Source
const (
	PropertiesLabel           = "properties"
	AdditionalPropertiesLabel = "additionalProperties"
	XMLLabel                  = "xml"
	ItemsLabel                = "items"
	AllOfLabel                = "allOf"
	AnyOfLabel                = "anyOf"
	OneOfLabel                = "oneOf"
	NotLabel                  = "not"
	TypeLabel                 = "type"
	DiscriminatorLabel        = "discriminator"
	ExclusiveMinimumLabel     = "exclusiveMinimum"
	ExclusiveMaximumLabel     = "exclusiveMaximum"
	SchemaLabel               = "schema"
	SchemaTypeLabel           = "$schema"
)
View Source
const (
	TagsLabel         = "tags"
	ExternalDocsLabel = "externalDocs"
	NameLabel         = "name"
	DescriptionLabel  = "description"
)

Variables

This section is empty.

Functions

func ExtractExampleValue

func ExtractExampleValue(exp *yaml.Node) any

func ExtractSchema

func ExtractSchema(root *yaml.Node, idx *index.SpecIndex) (*low.NodeReference[*SchemaProxy], error)

Types

type Contact

type Contact struct {
	Name  low.NodeReference[string]
	URL   low.NodeReference[string]
	Email low.NodeReference[string]
}

func (*Contact) Build

func (c *Contact) Build(root *yaml.Node, idx *index.SpecIndex) error

type Discriminator

type Discriminator struct {
	PropertyName low.NodeReference[string]
	Mapping      map[low.KeyReference[string]]low.ValueReference[string]
}

func (*Discriminator) FindMappingValue

func (d *Discriminator) FindMappingValue(key string) *low.ValueReference[string]

type Example

type Example struct {
	Summary       low.NodeReference[string]
	Description   low.NodeReference[string]
	Value         low.NodeReference[any]
	ExternalValue low.NodeReference[string]
	Extensions    map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Example) Build

func (ex *Example) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Example) FindExtension

func (ex *Example) FindExtension(ext string) *low.ValueReference[any]

type ExternalDoc

type ExternalDoc struct {
	Description low.NodeReference[string]
	URL         low.NodeReference[string]
	Extensions  map[low.KeyReference[string]]low.ValueReference[any]
}

func (*ExternalDoc) Build

func (ex *ExternalDoc) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*ExternalDoc) FindExtension

func (ex *ExternalDoc) FindExtension(ext string) *low.ValueReference[any]

type Info

type Info struct {
	Title          low.NodeReference[string]
	Description    low.NodeReference[string]
	TermsOfService low.NodeReference[string]
	Contact        low.NodeReference[*Contact]
	License        low.NodeReference[*License]
	Version        low.NodeReference[string]
}

func (*Info) Build

func (i *Info) Build(root *yaml.Node, idx *index.SpecIndex) error

type License

type License struct {
	Name low.NodeReference[string]
	URL  low.NodeReference[string]
}

func (*License) Build

func (l *License) Build(root *yaml.Node, idx *index.SpecIndex) error

type Schema

type Schema struct {
	SchemaTypeRef        low.NodeReference[string]
	Title                low.NodeReference[string]
	MultipleOf           low.NodeReference[int64]
	Maximum              low.NodeReference[int64]
	ExclusiveMaximum     low.NodeReference[SchemaDynamicValue[bool, int64]]
	Minimum              low.NodeReference[int64]
	ExclusiveMinimum     low.NodeReference[SchemaDynamicValue[bool, int64]]
	MaxLength            low.NodeReference[int64]
	MinLength            low.NodeReference[int64]
	Pattern              low.NodeReference[string]
	Format               low.NodeReference[string]
	MaxItems             low.NodeReference[int64]
	MinItems             low.NodeReference[int64]
	UniqueItems          low.NodeReference[int64]
	MaxProperties        low.NodeReference[int64]
	MinProperties        low.NodeReference[int64]
	Required             low.NodeReference[[]low.ValueReference[string]]
	Enum                 low.NodeReference[[]low.ValueReference[string]]
	Type                 low.NodeReference[SchemaDynamicValue[string, []low.ValueReference[string]]]
	AllOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	OneOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	AnyOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Not                  low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Items                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Properties           low.NodeReference[map[low.KeyReference[string]]low.ValueReference[*SchemaProxy]]
	AdditionalProperties low.NodeReference[any]
	Description          low.NodeReference[string]
	ContentEncoding      low.NodeReference[string]
	ContentMediaType     low.NodeReference[string]
	Default              low.NodeReference[any]
	Nullable             low.NodeReference[bool]
	Discriminator        low.NodeReference[*Discriminator]
	ReadOnly             low.NodeReference[bool]
	WriteOnly            low.NodeReference[bool]
	XML                  low.NodeReference[*XML]
	ExternalDocs         low.NodeReference[*ExternalDoc]
	Example              low.NodeReference[any]
	Examples             low.NodeReference[[]low.ValueReference[any]]
	Deprecated           low.NodeReference[bool]
	Extensions           map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Schema) Build

func (s *Schema) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Schema) FindProperty

func (s *Schema) FindProperty(name string) *low.ValueReference[*SchemaProxy]

type SchemaDynamicValue added in v0.0.9

type SchemaDynamicValue[A any, B any] struct {
	N int // 0 == A, 1 == B
	A A
	B B
}

func (SchemaDynamicValue[A, B]) IsA added in v0.0.9

func (s SchemaDynamicValue[A, B]) IsA() bool

func (SchemaDynamicValue[A, B]) IsB added in v0.0.9

func (s SchemaDynamicValue[A, B]) IsB() bool

type SchemaProxy

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

func (*SchemaProxy) Build

func (sp *SchemaProxy) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*SchemaProxy) GetBuildError

func (sp *SchemaProxy) GetBuildError() error

func (*SchemaProxy) Schema

func (sp *SchemaProxy) Schema() *Schema

type Tag

type Tag struct {
	Name         low.NodeReference[string]
	Description  low.NodeReference[string]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Extensions   map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Tag) Build

func (t *Tag) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Tag) FindExtension

func (t *Tag) FindExtension(ext string) *low.ValueReference[any]

type XML

type XML struct {
	Name       low.NodeReference[string]
	Namespace  low.NodeReference[string]
	Prefix     low.NodeReference[string]
	Attribute  low.NodeReference[bool]
	Wrapped    low.NodeReference[bool]
	Extensions map[low.KeyReference[string]]low.ValueReference[any]
}

func (*XML) Build

func (x *XML) Build(root *yaml.Node, _ *index.SpecIndex) error

Jump to

Keyboard shortcuts

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