overlay

package
v0.41.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OverlayLabel     = "overlay"
	SelfLabel        = "$self"
	RefLabel         = "$ref"
	ComponentsLabel  = "components"
	FieldsLabel      = "fields"
	InfoLabel        = "info"
	ExtendsLabel     = "extends"
	ActionsLabel     = "actions"
	TitleLabel       = "title"
	VersionLabel     = "version"
	TargetLabel      = "target"
	DescriptionLabel = "description"
	UpdateLabel      = "update"
	RemoveLabel      = "remove"
	CopyLabel        = "copy"
)

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Ref         low.NodeReference[string]
	Target      low.NodeReference[string]
	Description low.NodeReference[string]
	Update      low.NodeReference[*yaml.Node]
	Remove      low.NodeReference[bool]
	Copy        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
}

Action represents a low-level Overlay Action Object. https://spec.openapis.org/overlay/v1.2.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() uint64

Hash will return a consistent Hash of the Action object

type Components added in v0.41.4

type Components struct {
	Actions    low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*ReusableAction]]]
	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
}

Components represents a low-level Overlay Components Object. https://spec.openapis.org/overlay/v1.2.0#components-object

func (*Components) Build added in v0.41.4

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

Build extracts reusable actions and extensions.

func (*Components) FindExtension added in v0.41.4

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

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

func (*Components) GetContext added in v0.41.4

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

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

func (*Components) GetExtensions added in v0.41.4

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

func (*Components) GetIndex added in v0.41.4

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

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

func (*Components) GetKeyNode added in v0.41.4

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

GetKeyNode returns the key yaml node of the Components object

func (*Components) GetRootNode added in v0.41.4

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

GetRootNode returns the root yaml node of the Components object

func (*Components) Hash added in v0.41.4

func (inf *Components) Hash() uint64

Hash will return a consistent Hash of the Components object

type Info

type Info struct {
	Title       low.NodeReference[string]
	Version     low.NodeReference[string]
	Description 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.2.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 (inf *Info) Hash() uint64

Hash will return a consistent Hash of the Info object

type Overlay

type Overlay struct {
	Overlay    low.NodeReference[string]
	Self       low.NodeReference[string]
	Components low.NodeReference[*Components]
	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.2.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() uint64

Hash will return a consistent Hash of the Overlay object

type ReusableAction added in v0.41.4

type ReusableAction struct {
	Description low.NodeReference[string]
	Fields      low.NodeReference[*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
}

ReusableAction represents a low-level Overlay ReusableAction Object. https://spec.openapis.org/overlay/v1.2.0#reusable-action-object

func (*ReusableAction) Build added in v0.41.4

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

Build extracts action fields and extensions.

func (*ReusableAction) FindExtension added in v0.41.4

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

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

func (*ReusableAction) GetContext added in v0.41.4

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

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

func (*ReusableAction) GetExtensions added in v0.41.4

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

func (*ReusableAction) GetIndex added in v0.41.4

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

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

func (*ReusableAction) GetKeyNode added in v0.41.4

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

GetKeyNode returns the key yaml node of the ReusableAction object

func (*ReusableAction) GetRootNode added in v0.41.4

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

GetRootNode returns the root yaml node of the ReusableAction object

func (*ReusableAction) Hash added in v0.41.4

func (inf *ReusableAction) Hash() uint64

Hash will return a consistent Hash of the ReusableAction object

Jump to

Keyboard shortcuts

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