wiring

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(r io.Reader, data *Data) error

func LoadDataFrom

func LoadDataFrom(from string, data *Data) error

TODO report list of files/sources

func LoadDir

func LoadDir(f fs.FS, root string, data *Data) error

func LoadFile

func LoadFile(f fs.FS, path string, data *Data) error

func SortByName

func SortByName[T metav1.Object](objs []T)

func ValidateFabric

func ValidateFabric(ctx context.Context, kube client.Client, fabricCfg *meta.FabricConfig) error

Types

type Data

type Data struct {
	SwitchGroup        *Store[*wiringapi.SwitchGroup]
	Switch             *Store[*wiringapi.Switch]
	Server             *Store[*wiringapi.Server]
	Connection         *Store[*wiringapi.Connection]
	SwitchProfile      *Store[*wiringapi.SwitchProfile]
	ServerProfile      *Store[*wiringapi.ServerProfile]
	IPv4Namespaces     *Store[*vpcapi.IPv4Namespace]
	VLANNamespace      *Store[*wiringapi.VLANNamespace]
	External           *Store[*vpcapi.External]
	ExternalAttachment *Store[*vpcapi.ExternalAttachment]

	Native *NativeData
}

func New

func New(objs ...metav1.Object) (*Data, error)

func (*Data) Add

func (d *Data) Add(objs ...metav1.Object) error

func (*Data) SaveTo

func (d *Data) SaveTo(path string) error

func (*Data) Update

func (d *Data) Update(objs ...metav1.Object) error

func (*Data) Write

func (d *Data) Write(ret io.Writer) error

type NativeData

type NativeData struct {
	client.WithWatch
}

func NewNativeData

func NewNativeData() (*NativeData, error)

type Store

type Store[T metav1.Object] struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore[T metav1.Object]() *Store[T]

func (*Store[T]) Add

func (s *Store[T]) Add(update bool, item T) error

func (*Store[T]) All

func (s *Store[T]) All() []T

func (*Store[T]) Get

func (s *Store[T]) Get(name string) T

func (*Store[T]) Lookup

func (s *Store[T]) Lookup(labels map[string]string) []T

func (*Store[T]) LookupLabel

func (s *Store[T]) LookupLabel(name, value string) []T

func (*Store[T]) Size

func (s *Store[T]) Size() int

Jump to

Keyboard shortcuts

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