storage

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStore

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

BoltStore implements Store interface using BoltDB

func NewBoltStore

func NewBoltStore(dataDir string) (*BoltStore, error)

NewBoltStore creates a new BoltDB-backed store

func (*BoltStore) Close

func (s *BoltStore) Close() error

Close closes the database

func (*BoltStore) CreateIngress

func (s *BoltStore) CreateIngress(ingress *types.Ingress) error

CreateIngress creates a new ingress

func (*BoltStore) CreateNetwork

func (s *BoltStore) CreateNetwork(network *types.Network) error

Network operations

func (*BoltStore) CreateNode

func (s *BoltStore) CreateNode(node *types.Node) error

Node operations

func (*BoltStore) CreateSecret

func (s *BoltStore) CreateSecret(secret *types.Secret) error

Secret operations

func (*BoltStore) CreateService

func (s *BoltStore) CreateService(service *types.Service) error

Service operations

func (*BoltStore) CreateTLSCertificate

func (s *BoltStore) CreateTLSCertificate(cert *types.TLSCertificate) error

CreateTLSCertificate creates a new TLS certificate

func (*BoltStore) CreateTask

func (s *BoltStore) CreateTask(task *types.Task) error

Task operations

func (*BoltStore) CreateVolume

func (s *BoltStore) CreateVolume(volume *types.Volume) error

Volume operations

func (*BoltStore) DeleteIngress

func (s *BoltStore) DeleteIngress(id string) error

DeleteIngress deletes an ingress

func (*BoltStore) DeleteNetwork

func (s *BoltStore) DeleteNetwork(id string) error

func (*BoltStore) DeleteNode

func (s *BoltStore) DeleteNode(id string) error

func (*BoltStore) DeleteSecret

func (s *BoltStore) DeleteSecret(id string) error

func (*BoltStore) DeleteService

func (s *BoltStore) DeleteService(id string) error

func (*BoltStore) DeleteTLSCertificate

func (s *BoltStore) DeleteTLSCertificate(id string) error

DeleteTLSCertificate deletes a TLS certificate

func (*BoltStore) DeleteTask

func (s *BoltStore) DeleteTask(id string) error

func (*BoltStore) DeleteVolume

func (s *BoltStore) DeleteVolume(id string) error

func (*BoltStore) GetCA

func (s *BoltStore) GetCA() ([]byte, error)

func (*BoltStore) GetIngress

func (s *BoltStore) GetIngress(id string) (*types.Ingress, error)

GetIngress retrieves an ingress by ID

func (*BoltStore) GetIngressByName

func (s *BoltStore) GetIngressByName(name string) (*types.Ingress, error)

GetIngressByName retrieves an ingress by name

func (*BoltStore) GetNetwork

func (s *BoltStore) GetNetwork(id string) (*types.Network, error)

func (*BoltStore) GetNode

func (s *BoltStore) GetNode(id string) (*types.Node, error)

func (*BoltStore) GetSecret

func (s *BoltStore) GetSecret(id string) (*types.Secret, error)

func (*BoltStore) GetSecretByName

func (s *BoltStore) GetSecretByName(name string) (*types.Secret, error)

func (*BoltStore) GetService

func (s *BoltStore) GetService(id string) (*types.Service, error)

func (*BoltStore) GetServiceByName

func (s *BoltStore) GetServiceByName(name string) (*types.Service, error)

func (*BoltStore) GetTLSCertificate

func (s *BoltStore) GetTLSCertificate(id string) (*types.TLSCertificate, error)

GetTLSCertificate retrieves a TLS certificate by ID

func (*BoltStore) GetTLSCertificateByName

func (s *BoltStore) GetTLSCertificateByName(name string) (*types.TLSCertificate, error)

GetTLSCertificateByName retrieves a TLS certificate by name

func (*BoltStore) GetTLSCertificatesByHost

func (s *BoltStore) GetTLSCertificatesByHost(host string) ([]*types.TLSCertificate, error)

GetTLSCertificatesByHost retrieves all TLS certificates that cover a specific host

func (*BoltStore) GetTask

func (s *BoltStore) GetTask(id string) (*types.Task, error)

func (*BoltStore) GetVolume

func (s *BoltStore) GetVolume(id string) (*types.Volume, error)

func (*BoltStore) GetVolumeByName

func (s *BoltStore) GetVolumeByName(name string) (*types.Volume, error)

func (*BoltStore) ListIngresses

func (s *BoltStore) ListIngresses() ([]*types.Ingress, error)

ListIngresses returns all ingresses

func (*BoltStore) ListNetworks

func (s *BoltStore) ListNetworks() ([]*types.Network, error)

func (*BoltStore) ListNodes

func (s *BoltStore) ListNodes() ([]*types.Node, error)

func (*BoltStore) ListSecrets

func (s *BoltStore) ListSecrets() ([]*types.Secret, error)

func (*BoltStore) ListServices

func (s *BoltStore) ListServices() ([]*types.Service, error)

func (*BoltStore) ListTLSCertificates

func (s *BoltStore) ListTLSCertificates() ([]*types.TLSCertificate, error)

ListTLSCertificates lists all TLS certificates

func (*BoltStore) ListTasks

func (s *BoltStore) ListTasks() ([]*types.Task, error)

func (*BoltStore) ListTasksByNode

func (s *BoltStore) ListTasksByNode(nodeID string) ([]*types.Task, error)

func (*BoltStore) ListTasksByService

func (s *BoltStore) ListTasksByService(serviceID string) ([]*types.Task, error)

func (*BoltStore) ListVolumes

func (s *BoltStore) ListVolumes() ([]*types.Volume, error)

func (*BoltStore) SaveCA

func (s *BoltStore) SaveCA(data []byte) error

Certificate Authority operations

func (*BoltStore) UpdateIngress

func (s *BoltStore) UpdateIngress(ingress *types.Ingress) error

UpdateIngress updates an existing ingress

func (*BoltStore) UpdateNode

func (s *BoltStore) UpdateNode(node *types.Node) error

func (*BoltStore) UpdateService

func (s *BoltStore) UpdateService(service *types.Service) error

func (*BoltStore) UpdateTLSCertificate

func (s *BoltStore) UpdateTLSCertificate(cert *types.TLSCertificate) error

UpdateTLSCertificate updates an existing TLS certificate

func (*BoltStore) UpdateTask

func (s *BoltStore) UpdateTask(task *types.Task) error

type Store

type Store interface {
	// Nodes
	CreateNode(node *types.Node) error
	GetNode(id string) (*types.Node, error)
	ListNodes() ([]*types.Node, error)
	UpdateNode(node *types.Node) error
	DeleteNode(id string) error

	// Services
	CreateService(service *types.Service) error
	GetService(id string) (*types.Service, error)
	GetServiceByName(name string) (*types.Service, error)
	ListServices() ([]*types.Service, error)
	UpdateService(service *types.Service) error
	DeleteService(id string) error

	// Tasks
	CreateTask(task *types.Task) error
	GetTask(id string) (*types.Task, error)
	ListTasks() ([]*types.Task, error)
	ListTasksByService(serviceID string) ([]*types.Task, error)
	ListTasksByNode(nodeID string) ([]*types.Task, error)
	UpdateTask(task *types.Task) error
	DeleteTask(id string) error

	// Secrets
	CreateSecret(secret *types.Secret) error
	GetSecret(id string) (*types.Secret, error)
	GetSecretByName(name string) (*types.Secret, error)
	ListSecrets() ([]*types.Secret, error)
	DeleteSecret(id string) error

	// Volumes
	CreateVolume(volume *types.Volume) error
	GetVolume(id string) (*types.Volume, error)
	GetVolumeByName(name string) (*types.Volume, error)
	ListVolumes() ([]*types.Volume, error)
	DeleteVolume(id string) error

	// Networks
	CreateNetwork(network *types.Network) error
	GetNetwork(id string) (*types.Network, error)
	ListNetworks() ([]*types.Network, error)
	DeleteNetwork(id string) error

	// Certificate Authority
	SaveCA(data []byte) error
	GetCA() ([]byte, error)

	// Ingresses
	CreateIngress(ingress *types.Ingress) error
	GetIngress(id string) (*types.Ingress, error)
	GetIngressByName(name string) (*types.Ingress, error)
	ListIngresses() ([]*types.Ingress, error)
	UpdateIngress(ingress *types.Ingress) error
	DeleteIngress(id string) error

	// TLS Certificates
	CreateTLSCertificate(cert *types.TLSCertificate) error
	GetTLSCertificate(id string) (*types.TLSCertificate, error)
	GetTLSCertificateByName(name string) (*types.TLSCertificate, error)
	GetTLSCertificatesByHost(host string) ([]*types.TLSCertificate, error)
	ListTLSCertificates() ([]*types.TLSCertificate, error)
	UpdateTLSCertificate(cert *types.TLSCertificate) error
	DeleteTLSCertificate(id string) error

	// Utility
	Close() error
}

Store defines the interface for cluster state storage This will be implemented by BoltDB-backed storage

Jump to

Keyboard shortcuts

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