sunbeam

package
v0.0.0-...-fa2e56c Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sunbeam provides the interface to talk to database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFeatureGate

func AddFeatureGate(ctx context.Context, s state.State, gateKey string, enabled bool) error

AddFeatureGate adds a feature gate to the database.

func AddJujuUser

func AddJujuUser(ctx context.Context, s state.State, name string, token string) error

AddJujuUser adds a Jujuuser to the database

func AddManifest

func AddManifest(ctx context.Context, s state.State, manifestid string, data string) error

AddManifest adds a manifest to the database

func AddNode

func AddNode(ctx context.Context, s state.State, name string, role []string, machineid int, systemid string) error

AddNode adds a node to the database

func AddStorageBackend

func AddStorageBackend(ctx context.Context, s state.State, name string, backendType string, principal string, modelUUID string, config string) error

AddStorageBackend adds a storage backend to the database

func CreateConfig

func CreateConfig(ctx context.Context, s state.State, key string, value string) error

CreateConfig adds a new ConfigItem to the database

func DeleteConfig

func DeleteConfig(ctx context.Context, s state.State, key string) error

DeleteConfig deletes a ConfigItem from the database

func DeleteFeatureGate

func DeleteFeatureGate(ctx context.Context, s state.State, gateKey string) error

DeleteFeatureGate deletes a feature gate from the database.

func DeleteJujuUser

func DeleteJujuUser(ctx context.Context, s state.State, name string) error

DeleteJujuUser deletes the juju user record from the database

func DeleteManifest

func DeleteManifest(ctx context.Context, s state.State, manifestid string) error

DeleteManifest deletes a manifest from database

func DeleteNode

func DeleteNode(ctx context.Context, s state.State, name string) error

DeleteNode deletes a node from database

func DeleteStorageBackend

func DeleteStorageBackend(ctx context.Context, s state.State, name string) error

DeleteStorageBackend deletes a storage backend from database

func DeleteTerraformLock

func DeleteTerraformLock(ctx context.Context, s state.State, name string, lock string) (apitypes.Lock, error)

DeleteTerraformLock deletes the terraform lock from the database

func DeleteTerraformState

func DeleteTerraformState(ctx context.Context, s state.State, name string) error

DeleteTerraformState deletes the terraform state from the database

func GetConfig

func GetConfig(ctx context.Context, s state.State, key string) (string, error)

GetConfig returns the ConfigItem based on key from the database

func GetConfigItemKeys

func GetConfigItemKeys(ctx context.Context, s state.State, prefix *string) ([]string, error)

GetConfigItemKeys returns the list of ConfigItem keys from the database

func GetFeatureGate

func GetFeatureGate(ctx context.Context, s state.State, gateKey string) (apitypes.FeatureGate, error)

GetFeatureGate returns a FeatureGate with the given gate key.

func GetJujuUser

func GetJujuUser(ctx context.Context, s state.State, name string) (apitypes.JujuUser, error)

GetJujuUser returns a JujuUser with the given name

func GetManifest

func GetManifest(ctx context.Context, s state.State, manifestid string) (apitypes.Manifest, error)

GetManifest returns a Manifest with the given id

func GetNode

func GetNode(ctx context.Context, s state.State, name string) (apitypes.Node, error)

GetNode returns a Node with the given name

func GetStorageBackend

func GetStorageBackend(ctx context.Context, s state.State, name string) (apitypes.StorageBackend, error)

GetStorageBackend returns a StorageBackend with the given name

func GetTerraformLock

func GetTerraformLock(ctx context.Context, s state.State, name string) (string, error)

GetTerraformLock returns the terraform lock from the database

func GetTerraformLocks

func GetTerraformLocks(ctx context.Context, s state.State) ([]string, error)

GetTerraformLocks returns the list of terraform locks from the database

func GetTerraformState

func GetTerraformState(ctx context.Context, s state.State, name string) (string, error)

GetTerraformState returns the terraform state from the database

func GetTerraformStates

func GetTerraformStates(ctx context.Context, s state.State) ([]string, error)

GetTerraformStates returns the list of terraform states from the database

func ListFeatureGates

func ListFeatureGates(ctx context.Context, s state.State) (apitypes.FeatureGates, error)

ListFeatureGates returns all the feature gates.

func ListJujuUsers

func ListJujuUsers(ctx context.Context, s state.State) (apitypes.JujuUsers, error)

ListJujuUsers returns the jujuusers from the database

func ListManifests

func ListManifests(ctx context.Context, s state.State) (apitypes.Manifests, error)

ListManifests return all the manifests

func ListNodes

func ListNodes(ctx context.Context, s state.State, roles []string) (apitypes.Nodes, error)

ListNodes return all the nodes, filterable by role (Optional)

func ListStorageBackends

func ListStorageBackends(ctx context.Context, s state.State) (apitypes.StorageBackends, error)

ListStorageBackends return all the storage backends, filterable by role (Optional)

func StartFeatureGateSync

func StartFeatureGateSync(ctx context.Context, s state.State)

StartFeatureGateSync starts a background goroutine that syncs feature gates from the cluster database to the local snap configuration.

func UpdateConfig

func UpdateConfig(ctx context.Context, s state.State, key string, value string) error

UpdateConfig updates a ConfigItem in the database

func UpdateFeatureGate

func UpdateFeatureGate(ctx context.Context, s state.State, gateKey string, enabled bool) error

UpdateFeatureGate updates a feature gate record in the database.

func UpdateJujuUser

func UpdateJujuUser(ctx context.Context, s state.State, name string, token string) error

UpdateJujuUser updates the juju user's token in the database

func UpdateNode

func UpdateNode(ctx context.Context, s state.State, name string, role []string, machineid int, systemid string) error

UpdateNode updates a node record in the database

func UpdateStorageBackend

func UpdateStorageBackend(ctx context.Context, s state.State, name string, backendType string, principal string, modelUUID string, config string) error

UpdateStorageBackend updates a storage backend record in the database

func UpdateTerraformLock

func UpdateTerraformLock(ctx context.Context, s state.State, name string, lock string) (apitypes.Lock, error)

UpdateTerraformLock updates the terraform lock record in the database

func UpdateTerraformState

func UpdateTerraformState(ctx context.Context, s state.State, name string, lockID string, state string) (apitypes.Lock, error)

UpdateTerraformState updates the terraform state record in the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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