store

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthSecrets = NewAuthSecretStore()
View Source
var ConfigMaps = NewConfigMapStore()
View Source
var Dataplanes = NewDataplaneStore()
View Source
var Deployments = NewDeploymentStore()
View Source
var Endpoints = NewEndpointStore()
View Source
var GatewayClasses = NewGatewayClassStore()
View Source
var GatewayConfigs = NewGatewayConfigStore()
View Source
var Gateways = NewGatewayStore()
View Source
var Namespaces = NewNamespaceStore()
View Source
var Nodes = NewNodeStore()
View Source
var Secrets = NewSecretStore()
View Source
var Services = NewServiceStore()
View Source
var StaticServices = NewStaticServiceStore()
View Source
var UDPRoutes = NewUDPRouteStore()
View Source
var UDPRoutesV1A2 = NewUDPRouteStore()

Functions

func DumpObject

func DumpObject(o client.Object) string

DumpObject convers an object into a human-readable form for logging.

func GetExternalAddress

func GetExternalAddress(n *corev1.Node) string

GetExternalAddress returns the first external IP or DNS address of a node

func GetNameFromKey

func GetNameFromKey(key string) types.NamespacedName

FIXME this is not safe against K8s changing the namespace-name separator

func GetNamespacedName

func GetNamespacedName(object client.Object) types.NamespacedName

func GetObjectKey

func GetObjectKey(object client.Object) string

func IsOwner added in v0.15.1

func IsOwner(owner, owned metav1.Object, kind string) bool

taken from redhat operator-utils: https://github.com/redhat-cop/operator-utils/blob/master/pkg/util/owner.go

func IsReferenceService added in v0.15.1

func IsReferenceService(ref *stnrgwv1.BackendRef) bool

IsReferenceService returns true of the provided BackendRef points to a Service.

func IsReferenceStaticService added in v0.15.1

func IsReferenceStaticService(ref *stnrgwv1.BackendRef) bool

IsReferenceStaticService returns true of the provided BackendRef points to a StaticService.

func Merge added in v0.15.1

func Merge(dst, src Store)

Merge merges a store with another one.

func UnpackConfigMap

func UnpackConfigMap(cm *corev1.ConfigMap) (stnrconfv1.StunnerConfig, error)

unpacks a stunner config

Types

type AuthSecretStore

type AuthSecretStore struct {
	Store
}

func NewAuthSecretStore

func NewAuthSecretStore() *AuthSecretStore

func (*AuthSecretStore) GetAll

func (s *AuthSecretStore) GetAll() []*corev1.Secret

GetAll returns all AuthSecret objects from the global storage.

func (*AuthSecretStore) GetObject

func (s *AuthSecretStore) GetObject(nsName types.NamespacedName) *corev1.Secret

GetObject returns a named AuthSecret object from the global storage

type ConfigMapStore

type ConfigMapStore struct {
	Store
}

func NewConfigMapStore

func NewConfigMapStore() *ConfigMapStore

func (*ConfigMapStore) DeepCopy added in v0.18.0

func (s *ConfigMapStore) DeepCopy() *ConfigMapStore

func (*ConfigMapStore) GetAll

func (s *ConfigMapStore) GetAll() []*corev1.ConfigMap

GetAll returns all ConfigMap objects from the global storage

func (*ConfigMapStore) GetObject

func (s *ConfigMapStore) GetObject(nsName types.NamespacedName) *corev1.ConfigMap

GetObject returns a named ConfigMap object from the global storage

type DataplaneStore added in v0.15.1

type DataplaneStore struct {
	Store
}

func NewDataplaneStore added in v0.15.1

func NewDataplaneStore() *DataplaneStore

func (*DataplaneStore) DeepCopy added in v0.18.0

func (s *DataplaneStore) DeepCopy() *DataplaneStore

func (*DataplaneStore) GetAll added in v0.15.1

func (s *DataplaneStore) GetAll() []*stnrgwv1.Dataplane

GetAll returns all Dataplane objects from the global storage.

func (*DataplaneStore) GetObject added in v0.15.1

func (s *DataplaneStore) GetObject(nsName types.NamespacedName) *stnrgwv1.Dataplane

GetObject returns a named Dataplane object from the global storage

type DeploymentStore added in v0.15.1

type DeploymentStore struct {
	Store
}

func NewDeploymentStore added in v0.15.1

func NewDeploymentStore() *DeploymentStore

func (*DeploymentStore) DeepCopy added in v0.18.0

func (s *DeploymentStore) DeepCopy() *DeploymentStore

func (*DeploymentStore) GetAll added in v0.15.1

func (s *DeploymentStore) GetAll() []*appv1.Deployment

GetAll returns all Deployment objects from the global storage

func (*DeploymentStore) GetObject added in v0.15.1

func (s *DeploymentStore) GetObject(nsName types.NamespacedName) *appv1.Deployment

GetObject returns a named Deployment object from the global storage

type EndpointStore

type EndpointStore struct {
	Store
}

func NewEndpointStore

func NewEndpointStore() *EndpointStore

func (*EndpointStore) GetAll

func (s *EndpointStore) GetAll() []*corev1.Endpoints

GetAll returns all Endpoint objects from the global storage

func (*EndpointStore) GetObject

func (s *EndpointStore) GetObject(nsName types.NamespacedName) *corev1.Endpoints

GetObject returns a named Endpoint object from the global storage

type GatewayClassStore

type GatewayClassStore struct {
	Store
}

func NewGatewayClassStore

func NewGatewayClassStore() *GatewayClassStore

func (*GatewayClassStore) DeepCopy added in v0.18.0

func (s *GatewayClassStore) DeepCopy() *GatewayClassStore

func (*GatewayClassStore) GetAll

func (s *GatewayClassStore) GetAll() []*gwapiv1.GatewayClass

GetAll returns all GatewayClass objects from the global storage

func (*GatewayClassStore) GetObject

GetObject returns a named GatewayClass object from the global storage

type GatewayConfigStore

type GatewayConfigStore struct {
	Store
}

func NewGatewayConfigStore

func NewGatewayConfigStore() *GatewayConfigStore

func (*GatewayConfigStore) GetAll

func (s *GatewayConfigStore) GetAll() []*stnrgwv1.GatewayConfig

GetAll returns all GatewayConfig objects from the global storage

func (*GatewayConfigStore) GetObject

GetObject returns a named GatewayConfig object from the global storage

type GatewayStore

type GatewayStore struct {
	Store
}

func NewGatewayStore

func NewGatewayStore() *GatewayStore

func (*GatewayStore) DeepCopy added in v0.18.0

func (s *GatewayStore) DeepCopy() *GatewayStore

func (*GatewayStore) GetAll

func (s *GatewayStore) GetAll() []*gwapiv1.Gateway

GetAll returns all Gateway objects from the global storage

func (*GatewayStore) GetFirst added in v0.15.1

func (s *GatewayStore) GetFirst() *gwapiv1.Gateway

GetFirst returns the first Gateway object from the storage

func (*GatewayStore) GetObject

func (s *GatewayStore) GetObject(nsName types.NamespacedName) *gwapiv1.Gateway

GetObject returns a named Gateway object from the global storage

func (*GatewayStore) ResetGateways added in v0.15.1

func (s *GatewayStore) ResetGateways(gws []*gwapiv1.Gateway)

ResetGateways resets a Gateway store from a list of Gateways.

type NamespaceStore added in v0.15.1

type NamespaceStore struct {
	Store
}

func NewNamespaceStore added in v0.15.1

func NewNamespaceStore() *NamespaceStore

func (*NamespaceStore) GetAll added in v0.15.1

func (s *NamespaceStore) GetAll() []*corev1.Namespace

GetAll returns all Namespace objects from the global storage

func (*NamespaceStore) GetObject added in v0.15.1

func (s *NamespaceStore) GetObject(nsName types.NamespacedName) *corev1.Namespace

GetObject returns a named Namespace object from the global storage

type NodeStore

type NodeStore struct {
	Store
}

func NewNodeStore

func NewNodeStore() *NodeStore

func (*NodeStore) GetAll

func (s *NodeStore) GetAll() []*corev1.Node

GetAll returns all Node objects from the global storage

func (*NodeStore) GetObject

func (s *NodeStore) GetObject(nsName types.NamespacedName) *corev1.Node

GetObject returns a named Node object from the global storage

type SecretStore

type SecretStore struct {
	Store
}

func NewSecretStore

func NewSecretStore() *SecretStore

func (*SecretStore) GetAll

func (s *SecretStore) GetAll() []*corev1.Secret

GetAll returns all Secret objects from the global storage

func (*SecretStore) GetObject

func (s *SecretStore) GetObject(nsName types.NamespacedName) *corev1.Secret

GetObject returns a named Secret object from the global storage

type ServiceStore

type ServiceStore struct {
	Store
}

func NewServiceStore

func NewServiceStore() *ServiceStore

func (*ServiceStore) DeepCopy added in v0.18.0

func (s *ServiceStore) DeepCopy() *ServiceStore

func (*ServiceStore) GetAll

func (s *ServiceStore) GetAll() []*corev1.Service

GetAll returns all Service objects from the global storage

func (*ServiceStore) GetObject

func (s *ServiceStore) GetObject(nsName types.NamespacedName) *corev1.Service

GetObject returns a named Service object from the global storage

type StaticServiceStore added in v0.15.1

type StaticServiceStore struct {
	Store
}

func NewStaticServiceStore added in v0.15.1

func NewStaticServiceStore() *StaticServiceStore

func (*StaticServiceStore) GetAll added in v0.15.1

func (s *StaticServiceStore) GetAll() []*stnrgwv1.StaticService

GetAll returns all StaticService objects from the global storage

func (*StaticServiceStore) GetObject added in v0.15.1

GetObject returns a named StaticService object from the global storage

type Store

type Store interface {
	// Get returns an object from the store
	Get(nsName types.NamespacedName) client.Object
	// Set resets the store to the specified objects
	Reset(objects []client.Object)
	// UpsertIfChanged adds the resource to the store and returns true if an actual update has
	// happened
	UpsertIfChanged(object client.Object) bool
	// Upsert adds the resource to the store
	Upsert(object client.Object)
	// Remove deletes an object from the store
	Remove(nsName types.NamespacedName)
	// Len returns the number of objects in the store
	Len() int
	// Objects returns all stored objects
	Objects() []client.Object
	// Flush empties the store
	Flush()
	// String returns a string with the keys of all stored objects
	String() string
}

func NewStore

func NewStore() Store

NewStore creates a new local object storage

type UDPRouteStore

type UDPRouteStore struct {
	Store
}

func NewUDPRouteStore

func NewUDPRouteStore() *UDPRouteStore

func (*UDPRouteStore) DeepCopy added in v0.18.0

func (s *UDPRouteStore) DeepCopy() *UDPRouteStore

func (*UDPRouteStore) GetAll

func (s *UDPRouteStore) GetAll() []*stnrgwv1.UDPRoute

GetAll returns all UDPRoute objects from the global storage

func (*UDPRouteStore) GetObject

func (s *UDPRouteStore) GetObject(nsName types.NamespacedName) *stnrgwv1.UDPRoute

GetObject returns a named UDPRoute object from the global storage

Jump to

Keyboard shortcuts

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