resolver

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package resolver provides functionality for looking up resource metadata definitions using a resource kind or alias.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(rs []Resource)

Init initializes the collection of known Resource metadata definitions.

Types

type Resource

type Resource struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`

	Aliases []string `yaml:"aliases"`

	Namespaced bool `yaml:"namespaced"`

	References []struct {
		Kind string `yaml:"kind"`

		Paths []string `yaml:"paths"`
	} `yaml:"references"`
}

Resource is a metadata definition for a single kind.

func LookupAlias

func LookupAlias(name string) []Resource

LookupAlias returns Resource metadata definitions that match the given alias. For example, this could resolve the string "po" to a Pod metadata definition.

This function returns a Resource list since there might be multiple kinds with overlapping aliases.

func LookupKind

func LookupKind(kind string) (Resource, bool)

LookupKind returns the Resource metadata definition using the given kind. Meant to be used with a kind taken directly from an actual manifest.

Jump to

Keyboard shortcuts

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