resource

package
v0.0.0-...-80744b8 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileName

func FileName(resID resid.ResId) string

Types

type Builder

type Builder struct {
	Hit, Miss int
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(resID resid.ResId) *Builder

func NewNodeBuilder

func NewNodeBuilder(root *yaml.RNode) *Builder

func (*Builder) Add

func (b *Builder) Add(path Query, kind yaml.Kind) (*yaml.RNode, error)

func (*Builder) RNode

func (b *Builder) RNode() *yaml.RNode

func (*Builder) Set

func (b *Builder) Set(path Query, node *yaml.Node) (*yaml.RNode, error)

type FileStore

type FileStore struct {
	filesys.FileSystem
	NameGenerator func(resid.ResId) string
	PostProcessor func(string, []byte) []byte
}

func (*FileStore) WriteAll

func (store *FileStore) WriteAll(nodes iter.Seq2[resid.ResId, *yaml.RNode]) error

func (*FileStore) WriteKustomization

func (store *FileStore) WriteKustomization(kust *types.Kustomization) error

type Iterator

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

func NewIterator

func NewIterator(resources map[types.ClusterID]*yaml.RNode, schema *openapi.ResourceSchema) *Iterator

func (*Iterator) Clusters

func (it *Iterator) Clusters() []types.ClusterID

func (*Iterator) Error

func (it *Iterator) Error() error

func (*Iterator) Next

func (it *Iterator) Next() bool

func (*Iterator) Path

func (it *Iterator) Path() Query

func (*Iterator) Schema

func (it *Iterator) Schema() *openapi.ResourceSchema

func (*Iterator) Values

func (it *Iterator) Values() iter.Seq2[types.ClusterID, *yaml.Node]

type Queries

type Queries[M any] struct {
	// contains filtered or unexported fields
}

func NewQueries

func NewQueries[M any](queries iter.Seq2[M, Query]) *Queries[M]

func (*Queries[M]) Add

func (qq *Queries[M]) Add(query Query, meta M)

func (*Queries[M]) Scan

func (qq *Queries[M]) Scan(node *yaml.RNode) iter.Seq2[M, *yaml.RNode]

type Query

type Query []string //nolint:recvcheck

Query represents YAML node path.

func (Query) IsLookup

func (p Query) IsLookup() bool

func (Query) IsWildcard

func (p Query) IsWildcard() bool

func (Query) Normalize

func (p Query) Normalize() (Query, []string, error)

func (Query) String

func (p Query) String() string

String returns a text representation of the path.

func (*Query) UnmarshalYAML

func (p *Query) UnmarshalYAML(node *yaml.Node) error

type ValueGroup

type ValueGroup struct {
	Value    *yaml.Node
	Clusters []types.ClusterID
	// contains filtered or unexported fields
}

func GroupByValue

func GroupByValue(values iter.Seq2[types.ClusterID, *yaml.Node]) []*ValueGroup

Jump to

Keyboard shortcuts

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