datastore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	// This gets all clusters that match the color code
	GetClusters(colorCodes []string) ([]types.SubmarinerCluster, error)
	// This gets a single cluster based on cluster ID and returns a v1.Cluster or error based on what it retrieves
	GetCluster(clusterId string) (types.SubmarinerCluster, error)
	// This gets all endpoints for the given cluster ID
	GetEndpoints(clusterId string) ([]types.SubmarinerEndpoint, error)
	// This gets a single endpoint based on the cluster ID and cableName passed in
	GetEndpoint(clusterId string, cableName string) (types.SubmarinerEndpoint, error)
	// Watches all clusters and calls the passed in function on cluster change
	WatchClusters(ctx context.Context, selfClusterId string, colorCodes []string, onClusterChange func(cluster types.SubmarinerCluster, deleted bool) error) error
	// Performs a watch of all endpoints and calls the passed in function based on information
	WatchEndpoints(ctx context.Context, selfClusterId string, colorCodes []string, onEndpointChange func(endpoint types.SubmarinerEndpoint, deleted bool) error) error
	// This should be called to set the local cluster information.
	SetCluster(cluster types.SubmarinerCluster) error
	// This should only ever be called to set the endpoint of the local node.
	SetEndpoint(local types.SubmarinerEndpoint) error
	// This should be called to remove an endpoint from use
	RemoveEndpoint(clusterId, cableName string) error
	// This should be called to remove a cluster from use
	RemoveCluster(clusterId string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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