Documentation
¶
Overview ¶
Package state provides the persistent storage layer for component states.
Index ¶
- Constants
- Variables
- func CreateMachineIDIfNotExist(ctx context.Context, dbRW *sql.DB, dbRO *sql.DB, providedUID string) (string, error)
- func CreateTableAPIVersion(ctx context.Context, db *sql.DB) error
- func CreateTableMachineMetadata(ctx context.Context, dbRW *sql.DB) error
- func GetComponents(ctx context.Context, db *sql.DB, machineID string) (string, error)
- func GetLoginInfo(ctx context.Context, dbRO *sql.DB, machineID string) (string, error)
- func GetMachineID(ctx context.Context, dbRO *sql.DB) (string, error)
- func ReadLatestAPIVersion(ctx context.Context, db *sql.DB) (string, error)
- func RecordMetrics(ctx context.Context, db *sql.DB) error
- func Register(reg *prometheus.Registry) error
- func UpdateAPIVersionIfNotExists(ctx context.Context, db *sql.DB, apiVersion string) (string, error)
- func UpdateComponents(ctx context.Context, db *sql.DB, machineID string, components string) error
- func UpdateLoginInfo(ctx context.Context, dbRW *sql.DB, machineID string, token string) error
Constants ¶
View Source
const ( TableNameAPIVersion = "api_version" ColumnAPIVersion = "version" )
View Source
const ( TableNameMachineMetadata = "machine_metadata" ColumnMachineID = "machine_id" ColumnUnixSeconds = "unix_seconds" ColumnToken = "token" ColumnComponents = "components" )
Variables ¶
View Source
var ErrEmptyAPIVersion = errors.New("api version is empty")
Functions ¶
func CreateTableAPIVersion ¶ added in v0.1.6
func CreateTableMachineMetadata ¶ added in v0.1.6
func GetComponents ¶
func GetLoginInfo ¶
func GetMachineID ¶ added in v0.3.8
Reads the machine ID from the database. Returns an empty string and sql.ErrNoRows if the machine ID is not found.
func ReadLatestAPIVersion ¶ added in v0.4.0
ReadLatestAPIVersion reads the latest API version from the database.
func Register ¶
func Register(reg *prometheus.Registry) error
func UpdateComponents ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.