clusterinfo

package
v1.3.0-rc.0...-12c9840 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterHookApiPath = "/api/pipeline-clusters/actions/hook"
)

Functions

func GetClusterInfoByName

func GetClusterInfoByName(clusterName string) (apistructs.ClusterInfo, error)

TODO: GetClusterInfoByName after action executor become provider, remove the following methods

Types

type ClusterInfoCache

type ClusterInfoCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClusterInfoCache

func NewClusterInfoCache() *ClusterInfoCache

func (*ClusterInfoCache) DeleteClusterInfo

func (c *ClusterInfoCache) DeleteClusterInfo(name string)

func (*ClusterInfoCache) GetAllClusters

func (c *ClusterInfoCache) GetAllClusters() []apistructs.ClusterInfo

func (*ClusterInfoCache) GetClusterInfoByName

func (c *ClusterInfoCache) GetClusterInfoByName(name string) (apistructs.ClusterInfo, bool)

func (*ClusterInfoCache) UpdateClusterInfo

func (c *ClusterInfoCache) UpdateClusterInfo(clusterInfo apistructs.ClusterInfo)

type ClusterInfoNotifier

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

func NewClusterInfoNotifier

func NewClusterInfoNotifier() *ClusterInfoNotifier

func (*ClusterInfoNotifier) NotifyClusterEvent

func (c *ClusterInfoNotifier) NotifyClusterEvent(event apistructs.ClusterEvent)

func (*ClusterInfoNotifier) NotifyRefreshEvent

func (c *ClusterInfoNotifier) NotifyRefreshEvent()

func (*ClusterInfoNotifier) RegisterClusterEvent

func (c *ClusterInfoNotifier) RegisterClusterEvent() <-chan apistructs.ClusterEvent

func (*ClusterInfoNotifier) RegisterRefreshEvent

func (c *ClusterInfoNotifier) RegisterRefreshEvent() <-chan struct{}

type Interface

type Interface interface {
	// GetClusterByName return ClusterInfo query by name, contain cluster connection info and config map data
	GetClusterInfoByName(string) (apistructs.ClusterInfo, error)
	// ListAllClusterInfos return all clusters, contain cluster connection info and config map data
	ListAllClusterInfos() ([]apistructs.ClusterInfo, error)
	// DispatchClusterEvent dispatch cluster event received from eventbox
	// other modules can get event by channel if registered
	DispatchClusterEvent(apistructs.ClusterEvent)
	// BatchUpdateAndDispatchRefresh batch update all clusters, and dispatch refresh event if registered
	BatchUpdateAndDispatchRefresh() error
	// RegisterClusterEvent return channel to receive cluster event
	RegisterClusterEvent() <-chan apistructs.ClusterEvent
	// RegisterRefreshEvent return channel to receive refresh event
	RegisterRefreshEvent() <-chan struct{}
	// ListEdgeClusterInfos return all edge clusters, contain cluster connection info and config map data
	ListEdgeClusterInfos() ([]apistructs.ClusterInfo, error)
}

Interface defines the interface for the clusterinfo provider

type Notifier

type Notifier interface {
	RegisterClusterEvent() <-chan apistructs.ClusterEvent
	RegisterRefreshEvent() <-chan struct{}

	NotifyClusterEvent(event apistructs.ClusterEvent)
	NotifyRefreshEvent()
}

Jump to

Keyboard shortcuts

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