postgres

package
v0.0.0-...-4cc87ec Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL             string
	MaxConnIdleTime string
	ConnectTimeout  string
	MaxConnections  int32
	MinConnections  int32
}

Config holds PostgreSQL configuration

type Storage

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

Storage implements the storage.Storage interface using PostgreSQL

func New

func New(ctx context.Context, cfg Config) (*Storage, error)

New creates a new PostgreSQL storage instance

func (*Storage) Close

func (s *Storage) Close()

Close closes the database connection pool

func (*Storage) ClusterExists

func (s *Storage) ClusterExists(ctx context.Context, id string) (bool, error)

ClusterExists checks if a cluster exists

func (*Storage) CreateAgent

func (s *Storage) CreateAgent(ctx context.Context, agent *v1.Agent) error

CreateAgent creates a new agent

func (*Storage) CreateCluster

func (s *Storage) CreateCluster(ctx context.Context, cluster *v1.Cluster) error

CreateCluster creates a new cluster

func (*Storage) DeleteAgent

func (s *Storage) DeleteAgent(ctx context.Context, id string) error

DeleteAgent deletes an agent by ID

func (*Storage) DeleteCluster

func (s *Storage) DeleteCluster(ctx context.Context, id string) error

DeleteCluster deletes a cluster by ID

func (*Storage) GetAgent

func (s *Storage) GetAgent(ctx context.Context, id string) (*v1.Agent, error)

GetAgent retrieves an agent by ID

func (*Storage) GetCluster

func (s *Storage) GetCluster(ctx context.Context, id string) (*v1.Cluster, error)

GetCluster retrieves a cluster by ID

func (*Storage) ListAgents

func (s *Storage) ListAgents(ctx context.Context, clusterID string) ([]*v1.Agent, error)

ListAgents lists agents, optionally filtered by cluster

func (*Storage) ListClusters

func (s *Storage) ListClusters(ctx context.Context) ([]*v1.Cluster, error)

ListClusters lists all clusters

func (*Storage) UpdateAgent

func (s *Storage) UpdateAgent(ctx context.Context, agent *v1.Agent) error

UpdateAgent updates an existing agent

func (*Storage) UpdateCluster

func (s *Storage) UpdateCluster(ctx context.Context, cluster *v1.Cluster) error

UpdateCluster updates an existing cluster

Jump to

Keyboard shortcuts

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