resource

package
v0.0.0-...-4afb93c Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Overview

Package resource contains core abstract types for representing configuration resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullName

type FullName struct {
	Namespace Namespace
	Name      LocalName
}

FullName is a name that uniquely identifies a resource within the mesh.

func NewFullName

func NewFullName(ns Namespace, n LocalName) FullName

NewFullName creates a new FullName from the given Namespace and Name.

func NewShortOrFullName

func NewShortOrFullName(defaultNamespace Namespace, name string) FullName

NewShortOrFullName tries to parse the given name to resource.Name. If the name does not include namespace information, the defaultNamespace is used.

func (FullName) String

func (n FullName) String() string

String interface implementation.

func (FullName) Validate

func (n FullName) Validate() error

Validate that the Name and Namespace are set.

type Instance

type Instance struct {
	Metadata Metadata
	Message  config.Spec
	Origin   Origin
}

Instance is the abstract representation of a versioned config resource in Istio.

func PilotConfigToInstance

func PilotConfigToInstance(c *config.Config, schema resource.Schema) *Instance

PilotConfigToInstance convert from config.Config, which has no associated proto, to MCP Resource proto.

func (*Instance) Clone

func (r *Instance) Clone() *Instance

Clone returns a deep-copy of this entry. Warning, this is expensive!

func (*Instance) IsEmpty

func (r *Instance) IsEmpty() bool

IsEmpty returns true if the resource Instance.Message is nil.

type LocalName

type LocalName string

LocalName that uniquely identifies the resource within the Namespace.

func (LocalName) String

func (n LocalName) String() string

type Metadata

type Metadata struct {
	Schema      resource.Schema
	FullName    FullName
	CreateTime  time.Time
	Version     Version
	Generation  int64
	Labels      map[string]string
	Annotations map[string]string
}

Metadata about a resource.

func (*Metadata) Clone

func (m *Metadata) Clone() Metadata

Clone Metadata. Warning, this is expensive!

type Namespace

type Namespace string

Namespace containing the resource.

func (Namespace) String

func (n Namespace) String() string

type Origin

type Origin interface {
	FriendlyName() string
	Namespace() Namespace
	Reference() Reference

	// FieldMap returns the flat map containing paths of the fields in the resource as keys,
	// and their corresponding line numbers as values
	FieldMap() map[string]int
	Comparator() string

	// ClusterName returns the cluster name where the resource is located
	ClusterName() cluster.ID
}

Origin of a resource. This is source-implementation dependent.

type Reference

type Reference interface {
	String() string
}

Reference provides more information about an Origin. This is also source-implementation dependent.

type Version

type Version string

Version is the version identifier of a resource.

Jump to

Keyboard shortcuts

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