Documentation
¶
Index ¶
- Constants
- type Chart
- func (c *Chart) Bind(secrets ...*secret.Secret) error
- func (c *Chart) Build(root spec.Spec) ([]spec.Spec, error)
- func (c *Chart) GetAnnotations() map[string]string
- func (c *Chart) GetEnv() map[string][]spec.Value
- func (c *Chart) GetID() uuid.UUID
- func (c *Chart) GetInbounds() map[string][]spec.Port
- func (c *Chart) GetName() string
- func (c *Chart) GetNamespace() string
- func (c *Chart) GetOutbounds() map[string][]spec.Port
- func (c *Chart) GetSpecs() []*spec.Unstructured
- func (c *Chart) IsBound(secrets ...*secret.Secret) bool
- func (c *Chart) SetAnnotations(val map[string]string)
- func (c *Chart) SetEnv(val map[string][]spec.Value)
- func (c *Chart) SetID(val uuid.UUID)
- func (c *Chart) SetInbounds(val map[string][]spec.Port)
- func (c *Chart) SetName(val string)
- func (c *Chart) SetNamespace(val string)
- func (c *Chart) SetOutbounds(val map[string][]spec.Port)
- func (c *Chart) SetSpecs(val []*spec.Unstructured)
- type LinkHook
- type LinkHooks
- type Linker
- type Loader
- type LoaderConfig
- type Store
- type Stream
- type Table
- type TableOption
- type UnlinkHook
- type UnlinkHooks
Constants ¶
const ( KeyID = "id" KeyNamespace = "namespace" KeyName = "name" KeyAnnotations = "annotations" KeySpecs = "specs" KeyInbounds = "inbounds" KeyOutbounds = "outbounds" KeyEnv = "env" )
Key constants for commonly used fields.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chart ¶
type Chart struct { ID uuid.UUID `json:"id" bson:"_id" yaml:"id" map:"id" validate:"required"` Namespace string `json:"namespace" bson:"namespace" yaml:"namespace" map:"namespace" validate:"required"` Name string `json:"name,omitempty" bson:"name,omitempty" yaml:"name,omitempty" map:"name,omitempty"` Annotations map[string]string `json:"annotations,omitempty" bson:"annotations,omitempty" yaml:"annotations,omitempty" map:"annotations,omitempty"` Specs []*spec.Unstructured `json:"specs" bson:"specs" yaml:"specs" map:"specs"` Inbounds map[string][]spec.Port `json:"inbounds,omitempty" bson:"inbounds,omitempty" yaml:"inbounds,omitempty" map:"inbounds,omitempty"` Outbounds map[string][]spec.Port `json:"outbounds,omitempty" bson:"outbounds,omitempty" yaml:"outbounds,omitempty" map:"outbounds,omitempty"` Env map[string][]spec.Value `json:"env,omitempty" bson:"env,omitempty" yaml:"env,omitempty" map:"env,omitempty"` }
Chart defines the structure that combines multiple nodes into a cluster node.
func (*Chart) GetAnnotations ¶
GetAnnotations returns the chart's annotations.
func (*Chart) GetInbounds ¶ added in v0.12.0
GetInbounds returns the chart's inbounds.
func (*Chart) GetNamespace ¶
GetNamespace returns the chart's namespace.
func (*Chart) GetOutbounds ¶ added in v0.12.0
GetOutbounds returns the chart's outbounds.
func (*Chart) GetSpecs ¶
func (c *Chart) GetSpecs() []*spec.Unstructured
GetSpecs returns the chart's specs.
func (*Chart) SetAnnotations ¶
SetAnnotations sets the chart's annotations.
func (*Chart) SetInbounds ¶ added in v0.12.0
SetInbounds sets the chart's inbounds.
func (*Chart) SetNamespace ¶
SetNamespace sets the chart's namespace.
func (*Chart) SetOutbounds ¶ added in v0.12.0
SetOutbounds sets the chart's outbounds.
func (*Chart) SetSpecs ¶
func (c *Chart) SetSpecs(val []*spec.Unstructured)
SetSpecs sets the chart's specs.
type LinkHook ¶
type LinkHook interface { // Link processes the loading of a chart and may return an error. Link(*Chart) error }
LinkHook defines an interface for handling the loading of a chart.
type Linker ¶
type Linker struct {
// contains filtered or unexported fields
}
Linker manages chart loading and unloading.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader synchronizes with spec.Store to load spec.Spec into the Table.
func NewLoader ¶
func NewLoader(config LoaderConfig) *Loader
NewLoader creates a new Loader instance with the provided configuration.
type LoaderConfig ¶
type LoaderConfig struct { Table *Table // Lookup table for storing loaded symbols ChartStore Store // ChartStore to retrieve charts from SecretStore secret.Store // SecretStore to retrieve secrets from }
LoaderConfig holds configuration for the Loader.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table manages charts and their references, allowing insertion, lookup, and removal.
func NewTable ¶
func NewTable(opts ...TableOption) *Table
NewTable creates and returns a new Table instance with the provided options.
func (*Table) Insert ¶
Insert adds a new chart to the table, freeing the previous chart if it exists.
type TableOption ¶
type TableOption struct { LinkHooks []LinkHook // LoadHooks are functions executed when symbols are loaded. UnlinkHooks []UnlinkHook // UnloadHooks are functions executed when symbols are unloaded. }
TableOption holds configurations for a Table instance.
type UnlinkHook ¶
type UnlinkHook interface { // Unlink is called when a chart is unloaded and may return an error. Unlink(*Chart) error }
UnlinkHook defines an interface for handling the unloading of a chart.
func UnlinkFunc ¶
func UnlinkFunc(unlink func(*Chart) error) UnlinkHook
UnlinkFunc creates an UnloadHook from the given function.
type UnlinkHooks ¶
type UnlinkHooks []UnlinkHook
UnlinkHooks is a slice of UnloadHook, processed in reverse order.
func (UnlinkHooks) Unlink ¶
func (h UnlinkHooks) Unlink(chrt *Chart) error