store

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBucketNotFound = errors.New("bucket not found")
	ErrKeyNotFound    = errors.New("key does not exist")
)

Functions

This section is empty.

Types

type ComputeAgentStore

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

ComputeAgentStore is a database that stores a key value pair of container id to compute agent server address

func NewComputeAgentStore

func NewComputeAgentStore(db *bolt.DB) *ComputeAgentStore

func (*ComputeAgentStore) Close

func (c *ComputeAgentStore) Close() error

func (*ComputeAgentStore) DeleteComputeAgent

func (c *ComputeAgentStore) DeleteComputeAgent(ctx context.Context, containerID string) error

DeleteComputeAgent deletes an entry in the database or returns an error if none exists `containerID` corresponds to the target key that the entry should be deleted for

func (*ComputeAgentStore) GetComputeAgent

func (c *ComputeAgentStore) GetComputeAgent(ctx context.Context, containerID string) (result string, err error)

GetComputeAgent returns the compute agent address of a single entry in the database for key `containerID` or returns an error if the key does not exist

func (*ComputeAgentStore) GetComputeAgents

func (c *ComputeAgentStore) GetComputeAgents(ctx context.Context) (map[string]string, error)

GetComputeAgents returns a map of the key value pairs stored in the database where the keys are the containerIDs and the values are the corresponding compute agent server addresses

func (*ComputeAgentStore) UpdateComputeAgent

func (c *ComputeAgentStore) UpdateComputeAgent(ctx context.Context, containerID string, address string) error

UpdateComputeAgent updates or adds an entry (if none already exists) to the database `address` corresponds to the address of the compute agent server for the `containerID`

type NetworkingStore

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

func NewNetworkingStore

func NewNetworkingStore(database *bolt.DB) *NetworkingStore

func (*NetworkingStore) Close

func (n *NetworkingStore) Close() error

func (*NetworkingStore) CreatEndpoint

func (n *NetworkingStore) CreatEndpoint(ctx context.Context, endpt *ncproxynetworking.Endpoint) error

func (*NetworkingStore) CreateNetwork

func (n *NetworkingStore) CreateNetwork(ctx context.Context, network *ncproxynetworking.Network) error

func (*NetworkingStore) DeleteEndpoint

func (n *NetworkingStore) DeleteEndpoint(ctx context.Context, endpointName string) error

func (*NetworkingStore) DeleteNetwork

func (n *NetworkingStore) DeleteNetwork(ctx context.Context, networkName string) error

func (*NetworkingStore) GetEndpointByName

func (n *NetworkingStore) GetEndpointByName(ctx context.Context, endpointName string) (*ncproxynetworking.Endpoint, error)

func (*NetworkingStore) GetNetworkByName

func (n *NetworkingStore) GetNetworkByName(ctx context.Context, networkName string) (*ncproxynetworking.Network, error)

func (*NetworkingStore) ListEndpoints

func (n *NetworkingStore) ListEndpoints(ctx context.Context) (results []*ncproxynetworking.Endpoint, err error)

func (*NetworkingStore) ListNetworks

func (n *NetworkingStore) ListNetworks(ctx context.Context) (results []*ncproxynetworking.Network, err error)

func (*NetworkingStore) UpdateEndpoint

func (n *NetworkingStore) UpdateEndpoint(ctx context.Context, endpt *ncproxynetworking.Endpoint) error

Jump to

Keyboard shortcuts

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