kvstore

package
v1.5.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BucketNameCurrent is the bucket name for bacalhau version v1.3.1 and beyond.
	BucketNameCurrent = "node_v1"
	// BucketNameV0 is the bucket name for bacalhau version v1.3.0 and below.
	BucketNameV0 = "nodes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeStore

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

func NewNodeStore

func NewNodeStore(ctx context.Context, params NodeStoreParams) (*NodeStore, error)

func (*NodeStore) Add

func (n *NodeStore) Add(ctx context.Context, state models.NodeState) error

Add adds a node state to the repo.

func (*NodeStore) Delete

func (n *NodeStore) Delete(ctx context.Context, nodeID string) error

Delete deletes a node state from the repo.

func (*NodeStore) Get

func (n *NodeStore) Get(ctx context.Context, nodeID string) (models.NodeState, error)

Get returns the node state for the given node ID.

func (*NodeStore) GetByPrefix

func (n *NodeStore) GetByPrefix(ctx context.Context, prefix string) (models.NodeState, error)

GetByPrefix returns the node state for the given node ID. Supports both full and short node IDs band currently iterates through all of the keys to find matches, due to NATS KVStore not supporting prefix searches (yet).

func (*NodeStore) List

func (n *NodeStore) List(ctx context.Context, filters ...routing.NodeStateFilter) ([]models.NodeState, error)

List returns a list of nodes

type NodeStoreParams

type NodeStoreParams struct {
	BucketName string
	Client     *nats.Conn
}

Jump to

Keyboard shortcuts

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