state

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package state provides the persistent storage layer for component states.

Index

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

This section is empty.

Functions

func Compact

func Compact(ctx context.Context, db *sql.DB) error

func CreateMachineIDIfNotExist

func CreateMachineIDIfNotExist(ctx context.Context, db *sql.DB, providedUID string) (string, time.Time, error)

func CreateTableAPIVersion added in v0.1.6

func CreateTableAPIVersion(ctx context.Context, db *sql.DB) error

func CreateTableMachineMetadata added in v0.1.6

func CreateTableMachineMetadata(ctx context.Context, db *sql.DB) error

func GetComponents

func GetComponents(ctx context.Context, db *sql.DB, machineID string) (string, error)

func GetLoginInfo

func GetLoginInfo(ctx context.Context, db *sql.DB, machineID string) (string, error)

func ReadAPIVersion

func ReadAPIVersion(ctx context.Context, db *sql.DB) (string, error)

func RecordMetrics

func RecordMetrics(ctx context.Context, db *sql.DB) error

func Register

func Register(reg *prometheus.Registry) error

func UpdateAPIVersion

func UpdateAPIVersion(ctx context.Context, db *sql.DB, apiVersion string) error

func UpdateAPIVersionIfNotExists

func UpdateAPIVersionIfNotExists(ctx context.Context, db *sql.DB, apiVersion string) (string, error)

func UpdateComponents

func UpdateComponents(ctx context.Context, db *sql.DB, machineID string, components string) error

func UpdateLoginInfo

func UpdateLoginInfo(ctx context.Context, db *sql.DB, machineID string, token string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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