model

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const StateFileVersion = "v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceState

type ResourceState struct {
	APIVersion string          `json:"apiVersion"`
	Kind       string          `json:"kind"`
	Metadata   *map[string]any `json:"metadata"`
}

func NewResourceState

func NewResourceState(res resource.Resource) ResourceState

func (*ResourceState) Equal

func (r *ResourceState) Equal(other *ResourceState) bool

func (*ResourceState) SameIdentity added in v0.9.3

func (r *ResourceState) SameIdentity(other *ResourceState, keys []string) bool

SameIdentity compares only the kind and the given metadata keys: the same resource, whatever else has changed.

func (*ResourceState) ToResource

func (r *ResourceState) ToResource() resource.Resource

type State

type State struct {
	Version     string          `json:"version"`
	LastUpdated string          `json:"lastUpdated"`
	Resources   []ResourceState `json:"resources"`
	// contains filtered or unexported fields
}

func NewState

func NewState() *State

func (*State) AddManagedResource

func (s *State) AddManagedResource(res resource.Resource)

func (*State) GetRemovedResources

func (s *State) GetRemovedResources(activeResources []resource.Resource) []resource.Resource

func (*State) IdentifyBy added in v0.9.3

func (s *State) IdentifyBy(identity func(kind string) []string)

IdentifyBy tells resources apart by the given metadata keys of their kind (see schema.Catalog.StateIdentity) instead of by all their metadata, so changing a description or labels does not make a resource look removed.

func (*State) IsResourceManaged

func (s *State) IsResourceManaged(ressource resource.Resource) bool

func (*State) RemoveManagedResource

func (s *State) RemoveManagedResource(res resource.Resource)

func (*State) RemoveManagedResourceKindName

func (s *State) RemoveManagedResourceKindName(kind schema.Kind, name string)

func (*State) RemoveManagedResourceVKM

func (s *State) RemoveManagedResourceVKM(apiVersion, kind string, metadata *map[string]any)

Jump to

Keyboard shortcuts

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