store

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenAuthOnly

func OpenAuthOnly(dbPath string) (*auth.AuthStore, *sqlx.DB, error)

OpenAuthOnly opens an EXISTING oddk database for the narrow purpose of managing CLI auth tokens from a separate process (the `oddk auth` commands). Unlike NewStore it runs no migrations and no startup writes - those belong to the daemon and would race (and MustExec-panic) against a running daemon. A busy_timeout lets the single token INSERT wait out the daemon's writer lock rather than failing immediately. The caller must Close the returned *sqlx.DB.

Types

type AuthToken

type AuthToken struct {
	ID          int64  `db:"id"`
	TokenPrefix string `db:"token_prefix"`
	TokenHash   string `db:"token_hash"`
	CreatedAt   string `db:"created_at"`
}

type Store

type Store struct {
	Sqlx          *sqlx.DB
	Auth          *auth.AuthStore
	Instances     *instances.InstanceStore
	Backup        *backup.BackupStore
	Cron          *cron.CronStore
	Notifications *notifications.NotificationStore
	Parameters    *parameters.ParameterStore
	Health        *health.HealthStore
	KV            *kvstore.KVStore
	Offsite       *offsite.OffsiteStore
}

func NewStore

func NewStore(dbPath, dataDir string) (*Store, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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