types

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster is used to store all keys of global services reported by a cluster. A cluster should be created by ClusterStore.New method

func (*Cluster) AddServiceKey

func (c *Cluster) AddServiceKey(key client.ObjectKey)

func (*Cluster) ExpireTime

func (c *Cluster) ExpireTime() time.Time

func (*Cluster) GetAllServiceKeys

func (c *Cluster) GetAllServiceKeys() []client.ObjectKey

func (*Cluster) IsExpired

func (c *Cluster) IsExpired() bool

func (*Cluster) Name

func (c *Cluster) Name() string

func (*Cluster) RemoveServiceKey

func (c *Cluster) RemoveServiceKey(key client.ObjectKey)

func (*Cluster) SetExpireTime

func (c *Cluster) SetExpireTime(expireTime time.Time)

type ClusterStore

type ClusterStore struct {
	// contains filtered or unexported fields
}

ClusterStore is used to manage clusters and is thread-safe

func NewClusterStore

func NewClusterStore() *ClusterStore

func (*ClusterStore) Get

func (store *ClusterStore) Get(name string) *Cluster

func (*ClusterStore) GetExpiredClusters

func (store *ClusterStore) GetExpiredClusters() []*Cluster

func (*ClusterStore) New

func (store *ClusterStore) New(name string) *Cluster

func (*ClusterStore) Remove

func (store *ClusterStore) Remove(name string)

func (*ClusterStore) RemoveClusters

func (store *ClusterStore) RemoveClusters(names ...string)

type Empty

type Empty struct{}

type ExportGlobalServiceFunc

type ExportGlobalServiceFunc func(ctx context.Context, service apis.GlobalService) error

type GlobalServiceManager

type GlobalServiceManager interface {
	// CreateOrMergeGlobalService will create global service if not exists
	// otherwise merge endpoints and ports of service passed in
	CreateOrMergeGlobalService(ctx context.Context, service apis.GlobalService) error

	// RevokeGlobalService will remove endpoints of cluster from global service
	// specified by namespace/name, if no endpoints left, the global service will
	// be also deleted
	RevokeGlobalService(ctx context.Context, clusterName, namespace, serviceName string) error
}

func NewGlobalServiceManager

func NewGlobalServiceManager(cli client.Client, allowCreateNamespace bool) GlobalServiceManager

type ObjectKeySet

type ObjectKeySet map[client.ObjectKey]Empty

func NewObjectKeySet

func NewObjectKeySet() ObjectKeySet

func (ObjectKeySet) Add

func (set ObjectKeySet) Add(key client.ObjectKey)

func (ObjectKeySet) Delete

func (set ObjectKeySet) Delete(key client.ObjectKey)

func (ObjectKeySet) Has

func (set ObjectKeySet) Has(key client.ObjectKey) bool

type RevokeGlobalServiceFunc

type RevokeGlobalServiceFunc func(ctx context.Context, clusterName, namespace, serviceName string) error

Jump to

Keyboard shortcuts

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