db

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentDB

type AgentDB interface {
	// AGENT - SELECTOR/PLUGIN interface
	CreateAgentEntry(sinfo types.AgentInfo) error
	GetAgentSelectors() (types.AgentInfoList, error)
	GetAgentPluginInfo(name string) (types.AgentInfo, error)

	// CLUSTER interface
	GetClusters() (types.ClusterInfoList, error)
	CreateClusterEntry(cinfo types.ClusterInfo) error
	EditClusterEntry(cinfo types.ClusterInfo) error
	DeleteClusterEntry(name string) error

	// AGENT - CLUSTER Get interface (for testing)e
	GetAgentClusterName(spiffeid string) (string, error)
	GetClusterAgents(name string) ([]string, error)
	GetAgentsMetadata(req types.AgentMetadataRequest) (types.AgentInfoList, error)
}

func NewLocalSqliteDB

func NewLocalSqliteDB(driverName string, dbpath string, backOffParams backoff.BackOff) (AgentDB, error)

type GetError

type GetError struct {
	Message string
}

GetError is an error intended to signify something wrong with a get request For example, non-existence

func (GetError) Error

func (e GetError) Error() string

type LocalSqliteDb

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

func (*LocalSqliteDb) CreateAgentEntry

func (db *LocalSqliteDb) CreateAgentEntry(sinfo types.AgentInfo) error

func (*LocalSqliteDb) CreateClusterEntry

func (db *LocalSqliteDb) CreateClusterEntry(cinfo types.ClusterInfo) error

func (*LocalSqliteDb) DeleteClusterEntry

func (db *LocalSqliteDb) DeleteClusterEntry(clustername string) error

func (*LocalSqliteDb) EditClusterEntry

func (db *LocalSqliteDb) EditClusterEntry(cinfo types.ClusterInfo) error

func (*LocalSqliteDb) GetAgentClusterName

func (db *LocalSqliteDb) GetAgentClusterName(spiffeid string) (string, error)

GetAgentClusterName takes in string of spiffeid of agent and outputs the name of the cluster

func (*LocalSqliteDb) GetAgentPluginInfo

func (db *LocalSqliteDb) GetAgentPluginInfo(spiffeid string) (types.AgentInfo, error)

func (*LocalSqliteDb) GetAgentSelectors

func (db *LocalSqliteDb) GetAgentSelectors() (types.AgentInfoList, error)

func (*LocalSqliteDb) GetAgentsMetadata

func (db *LocalSqliteDb) GetAgentsMetadata(req types.AgentMetadataRequest) (types.AgentInfoList, error)

GetAgentsMetadata takes a AgentMetadataRequest with a list of agent spiffeids outputs list of agentinfo objects, where spiffeids must be in the input list includes info on plugin and clustername

func (*LocalSqliteDb) GetClusterAgents

func (db *LocalSqliteDb) GetClusterAgents(name string) ([]string, error)

GetClusterAgents takes in string cluster name and outputs array of spiffeids of agents assigned to the cluster

func (*LocalSqliteDb) GetClusters

func (db *LocalSqliteDb) GetClusters() (types.ClusterInfoList, error)

GetClusters outputs a list of ClusterInfo structs with information on currently registered clusters

type PostFailure

type PostFailure struct {
	Message string
}

PostFailure is meant to signify when the state of the database has not changed

func (PostFailure) Error

func (e PostFailure) Error() string

type SQLError

type SQLError struct {
	Cmd string
	Err error
}

SQLError is an error where the input appears correct but the database acts up

func (SQLError) Error

func (e SQLError) Error() string

Jump to

Keyboard shortcuts

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