overlay

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverlayLabel     = "overlay"
	InfoLabel        = "info"
	ExtendsLabel     = "extends"
	ActionsLabel     = "actions"
	TitleLabel       = "title"
	VersionLabel     = "version"
	TargetLabel      = "target"
	DescriptionLabel = "description"
	UpdateLabel      = "update"
	RemoveLabel      = "remove"
)

Constants for labels used to look up values within OpenAPI Overlay specifications. https://spec.openapis.org/overlay/v1.0.0

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Target      low.NodeReference[string]
	Description low.NodeReference[string]
	Update      low.NodeReference[*yaml.Node]
	Remove      low.NodeReference[bool]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Action represents a low-level Overlay Action Object. https://spec.openapis.org/overlay/v1.0.0#action-object

func (*Action) Build

func (a *Action) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build will extract extensions for the Action object.

func (*Action) FindExtension

func (a *Action) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension returns a ValueReference containing the extension value, if found.

func (*Action) GetContext

func (a *Action) GetContext() context.Context

GetContext returns the context.Context instance used when building the Action object

func (*Action) GetExtensions

GetExtensions returns all Action extensions and satisfies the low.HasExtensions interface.

func (*Action) GetIndex

func (a *Action) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Action object

func (*Action) GetKeyNode

func (a *Action) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Action object

func (*Action) GetRootNode

func (a *Action) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Action object

func (*Action) Hash

func (a *Action) Hash() [32]byte

Hash will return a consistent SHA256 Hash of the Action object

type Info

type Info struct {
	Title      low.NodeReference[string]
	Version    low.NodeReference[string]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Info represents a low-level Overlay Info Object. https://spec.openapis.org/overlay/v1.0.0#info-object

func (*Info) Build

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

Build will extract extensions for the Info object.

func (*Info) FindExtension

func (i *Info) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension returns a ValueReference containing the extension value, if found.

func (*Info) GetContext

func (i *Info) GetContext() context.Context

GetContext returns the context.Context instance used when building the Info object

func (*Info) GetExtensions

func (i *Info) GetExtensions() *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]

GetExtensions returns all Info extensions and satisfies the low.HasExtensions interface.

func (*Info) GetIndex

func (i *Info) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Info object

func (*Info) GetKeyNode

func (i *Info) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Info object

func (*Info) GetRootNode

func (i *Info) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Info object

func (*Info) Hash

func (i *Info) Hash() [32]byte

Hash will return a consistent SHA256 Hash of the Info object

type Overlay

type Overlay struct {
	Overlay    low.NodeReference[string]
	Info       low.NodeReference[*Info]
	Extends    low.NodeReference[string]
	Actions    low.NodeReference[[]low.ValueReference[*Action]]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Overlay represents a low-level OpenAPI Overlay document. https://spec.openapis.org/overlay/v1.0.0

func (*Overlay) Build

func (o *Overlay) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build will extract all properties of the Overlay document.

func (*Overlay) FindExtension

func (o *Overlay) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension returns a ValueReference containing the extension value, if found.

func (*Overlay) GetContext

func (o *Overlay) GetContext() context.Context

GetContext returns the context.Context instance used when building the Overlay object

func (*Overlay) GetExtensions

GetExtensions returns all Overlay extensions and satisfies the low.HasExtensions interface.

func (*Overlay) GetIndex

func (o *Overlay) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Overlay object

func (*Overlay) GetKeyNode

func (o *Overlay) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Overlay object

func (*Overlay) GetRootNode

func (o *Overlay) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Overlay object

func (*Overlay) Hash

func (o *Overlay) Hash() [32]byte

Hash will return a consistent SHA256 Hash of the Overlay object

Jump to

Keyboard shortcuts

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