db

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAutoUpdateParams added in v0.2.0

type AddAutoUpdateParams struct {
	Environment string
	Namespace   string
	Kind        string
	Name        string
	Refs        string
	Digests     string
	Status      string
	Message     string
	JobID       string
	StartedAt   int64
	FinishedAt  int64
}

type AddBackupCodeParams added in v0.2.0

type AddBackupCodeParams struct {
	UserID   int64
	CodeHash []byte
}

type AddGitHostKeyParams added in v0.2.0

type AddGitHostKeyParams struct {
	Host string
	Key  string
	Now  int64
}

type ApiKey

type ApiKey struct {
	ID          int64
	UserID      int64
	Name        string
	Prefix      string
	TokenHash   []byte
	ReadOnly    int64
	CreatedAt   int64
	ExpiresAt   sql.NullInt64
	LastUsedAt  sql.NullInt64
	Permissions sql.NullString
}

type AuditLog added in v0.2.0

type AuditLog struct {
	ID          int64
	At          int64
	Username    string
	ApiKey      int64
	Action      string
	Method      string
	Path        string
	Environment string
	Namespace   string
	Object      string
	Status      int64
	Result      string
	Message     string
	JobID       string
	ClientIp    string
	UserAgent   string
	ApiKeyName  string
}

type AutoUpdate added in v0.2.0

type AutoUpdate struct {
	ID          int64
	Environment string
	Namespace   string
	Kind        string
	Name        string
	Refs        string
	Digests     string
	Status      string
	Message     string
	JobID       string
	StartedAt   int64
	FinishedAt  int64
}

type BackupTarget added in v0.2.0

type BackupTarget struct {
	ID        int64
	Name      string
	Kind      string
	Options   string
	Secret    string
	CreatedAt int64
	UpdatedAt int64
}

type CreateAPIKeyParams

type CreateAPIKeyParams struct {
	UserID      int64
	Name        string
	Prefix      string
	TokenHash   []byte
	ReadOnly    int64
	Permissions sql.NullString
	Now         int64
	ExpiresAt   sql.NullInt64
}

type CreateBackupTargetParams added in v0.2.0

type CreateBackupTargetParams struct {
	Name    string
	Kind    string
	Options string
	Secret  string
	Now     int64
}

type CreateGitCredentialParams added in v0.2.0

type CreateGitCredentialParams struct {
	Name       string
	Kind       string
	Username   string
	Secret     string
	Passphrase string
	Now        int64
}

type CreateGitStackParams added in v0.2.0

type CreateGitStackParams struct {
	Name          string
	Url           string
	Ref           string
	FullRef       string
	ComposePath   string
	CredentialID  sql.NullInt64
	CommitHash    string
	CommitMessage string
	CommitAuthor  string
	CommitAt      int64
	Now           int64
}

type CreateNotificationChannelParams added in v0.2.0

type CreateNotificationChannelParams struct {
	Name    string
	Type    string
	Config  string
	Events  string
	Enabled int64
	Now     int64
}

type CreatePasskeyParams added in v0.2.0

type CreatePasskeyParams struct {
	UserID       int64
	CredentialID []byte
	Name         string
	RpID         string
	Credential   string
	Now          int64
}

type CreateScheduleParams added in v0.2.0

type CreateScheduleParams struct {
	Name        string
	Kind        string
	Environment string
	Namespace   string
	Target      string
	Options     string
	Secret      string
	Cron        string
	Enabled     int64
	CreatedBy   string
	Now         int64
}

type CreateSessionParams

type CreateSessionParams struct {
	TokenHash []byte
	UserID    int64
	CsrfToken string
	Now       int64
	ExpiresAt int64
	ClientIp  string
	UserAgent string
	Method    string
}

type CreateStackTemplateParams added in v0.2.0

type CreateStackTemplateParams struct {
	Name        string
	Description string
	Compose     string
	Env         string
	CreatedBy   string
	Now         int64
}

type CreateUserParams

type CreateUserParams struct {
	Username           string
	PasswordHash       string
	Role               string
	MustChangePassword int64
	Now                int64
}

type CreateWebhookParams added in v0.2.0

type CreateWebhookParams struct {
	Name        string
	Environment string
	Namespace   string
	TargetKind  string
	Target      string
	Action      string
	TokenHash   string
	Enabled     int64
	CreatedBy   string
	Now         int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteExpiredSessionsParams

type DeleteExpiredSessionsParams struct {
	Now        int64
	IdleBefore int64
}

type DeleteOtherUserSessionsParams

type DeleteOtherUserSessionsParams struct {
	UserID int64
	Keep   []byte
}

type DeletePasskeyParams added in v0.2.0

type DeletePasskeyParams struct {
	ID     int64
	UserID int64
}

type DeleteUserAPIKeyParams

type DeleteUserAPIKeyParams struct {
	ID     int64
	UserID int64
}

type DeleteVariableParams added in v0.2.0

type DeleteVariableParams struct {
	Stack string
	Name  string
}

type DisableMFAParams added in v0.2.0

type DisableMFAParams struct {
	Now int64
	ID  int64
}

type EnableMFAParams added in v0.2.0

type EnableMFAParams struct {
	Step int64
	Now  int64
	ID   int64
}

type Event

type Event struct {
	ID          int64
	Environment string
	Ts          int64
	Namespace   string
	Topic       string
	Kind        string
	Action      string
	ObjectID    string
	ObjectName  string
	Attributes  string
}

type FinishScheduleRunParams added in v0.2.0

type FinishScheduleRunParams struct {
	FinishedAt int64
	Status     string
	Message    string
	ID         int64
}

type GetAPIKeyWithUserRow

type GetAPIKeyWithUserRow struct {
	ApiKey ApiKey
	User   User
}

type GetSessionWithUserRow

type GetSessionWithUserRow struct {
	Session Session
	User    User
}

type GetVariableParams added in v0.2.0

type GetVariableParams struct {
	Stack string
	Name  string
}

type GitCredential added in v0.2.0

type GitCredential struct {
	ID         int64
	Name       string
	Kind       string
	Username   string
	Secret     string
	Passphrase string
	CreatedAt  int64
	UpdatedAt  int64
}

type GitKnownHost added in v0.2.0

type GitKnownHost struct {
	Host      string
	Key       string
	CreatedAt int64
}

type GitStack added in v0.2.0

type GitStack struct {
	Name          string
	Url           string
	Ref           string
	FullRef       string
	ComposePath   string
	CredentialID  sql.NullInt64
	CommitHash    string
	CommitMessage string
	CommitAuthor  string
	CommitAt      int64
	PulledAt      int64
	LastError     string
	CreatedAt     int64
	AutoUpdate    string
	PollInterval  int64
	WebhookHash   string
	CheckedAt     int64
	RemoteHash    string
}

type ImageUpdate added in v0.1.1

type ImageUpdate struct {
	Environment  string
	Ref          string
	RemoteDigest string
	Error        string
	CheckedAt    int64
	SeenAt       int64
}

type InsertAuditParams added in v0.2.0

type InsertAuditParams struct {
	At          int64
	Username    string
	ApiKey      int64
	ApiKeyName  string
	Action      string
	Method      string
	Path        string
	Environment string
	Namespace   string
	Object      string
	Status      int64
	Result      string
	Message     string
	JobID       string
	ClientIp    string
	UserAgent   string
}

type InsertEventParams

type InsertEventParams struct {
	Environment string
	Ts          int64
	Namespace   string
	Topic       string
	Kind        string
	Action      string
	ObjectID    string
	ObjectName  string
	Attributes  string
}

type InsertScheduleRunParams added in v0.2.0

type InsertScheduleRunParams struct {
	ScheduleID int64
	Trigger    string
	StartedAt  int64
	Status     string
	Message    string
	JobID      string
}

type LastAutoUpdateParams added in v0.2.0

type LastAutoUpdateParams struct {
	Environment string
	Namespace   string
	Kind        string
	Name        string
}

type ListAuditParams added in v0.2.0

type ListAuditParams struct {
	Before   int64
	Since    int64
	Until    int64
	Username string
	Result   string
	Q        string
	MaxRows  int64
}

type ListAutoUpdatesParams added in v0.2.0

type ListAutoUpdatesParams struct {
	Environment string
	Namespace   string
	MaxRows     int64
}

type ListEventsParams

type ListEventsParams struct {
	Environment string
	Before      int64
	Namespace   string
	Kind        string
	Object      string
	Lim         int64
}

type ListScheduleRunsParams added in v0.2.0

type ListScheduleRunsParams struct {
	ScheduleID int64
	Limit      int64
}

type MfaBackupCode added in v0.2.0

type MfaBackupCode struct {
	UserID   int64
	CodeHash []byte
}

type NotificationChannel added in v0.2.0

type NotificationChannel struct {
	ID         int64
	Name       string
	Type       string
	Config     string
	Events     string
	Enabled    int64
	LastSentAt int64
	LastError  string
	CreatedAt  int64
	UpdatedAt  int64
}

type Passkey added in v0.2.0

type Passkey struct {
	ID           int64
	UserID       int64
	CredentialID []byte
	Name         string
	RpID         string
	Credential   string
	CreatedAt    int64
	LastUsedAt   sql.NullInt64
}

type PruneAutoUpdatesParams added in v0.2.0

type PruneAutoUpdatesParams struct {
	Environment string
	Before      int64
}

type PruneScheduleRunsParams added in v0.2.0

type PruneScheduleRunsParams struct {
	ScheduleID int64
	Keep       int64
}

type PutVariableParams added in v0.2.0

type PutVariableParams struct {
	Stack     string
	Name      string
	Value     string
	Secret    int64
	UpdatedBy string
	UpdatedAt int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddAutoUpdate added in v0.2.0

func (q *Queries) AddAutoUpdate(ctx context.Context, arg AddAutoUpdateParams) error

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) AddBackupCode added in v0.2.0

func (q *Queries) AddBackupCode(ctx context.Context, arg AddBackupCodeParams) error

func (*Queries) AddGitHostKey added in v0.2.0

func (q *Queries) AddGitHostKey(ctx context.Context, arg AddGitHostKeyParams) error

func (*Queries) CountActiveAdmins

func (q *Queries) CountActiveAdmins(ctx context.Context) (int64, error)

func (*Queries) CountBackupCodes added in v0.2.0

func (q *Queries) CountBackupCodes(ctx context.Context, userID int64) (int64, error)

func (*Queries) CountGitStacksByCredential added in v0.2.0

func (q *Queries) CountGitStacksByCredential(ctx context.Context, credentialID sql.NullInt64) (int64, error)

func (*Queries) CountPasskeys added in v0.2.0

func (q *Queries) CountPasskeys(ctx context.Context, id int64) error

Keeps users.passkey_count in step with the passkeys table; run after every change.

func (*Queries) CountUserAPIKeys

func (q *Queries) CountUserAPIKeys(ctx context.Context, userID int64) (int64, error)

func (*Queries) CountUsers

func (q *Queries) CountUsers(ctx context.Context) (int64, error)

func (*Queries) CreateAPIKey

func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (ApiKey, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) CreateBackupTarget added in v0.2.0

func (q *Queries) CreateBackupTarget(ctx context.Context, arg CreateBackupTargetParams) (BackupTarget, error)

func (*Queries) CreateGitCredential added in v0.2.0

func (q *Queries) CreateGitCredential(ctx context.Context, arg CreateGitCredentialParams) (GitCredential, error)

func (*Queries) CreateGitStack added in v0.2.0

func (q *Queries) CreateGitStack(ctx context.Context, arg CreateGitStackParams) error

func (*Queries) CreateNotificationChannel added in v0.2.0

func (q *Queries) CreateNotificationChannel(ctx context.Context, arg CreateNotificationChannelParams) (NotificationChannel, error)

func (*Queries) CreatePasskey added in v0.2.0

func (q *Queries) CreatePasskey(ctx context.Context, arg CreatePasskeyParams) (Passkey, error)

func (*Queries) CreateSchedule added in v0.2.0

func (q *Queries) CreateSchedule(ctx context.Context, arg CreateScheduleParams) (Schedule, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) CreateStackTemplate added in v0.2.0

func (q *Queries) CreateStackTemplate(ctx context.Context, arg CreateStackTemplateParams) (StackTemplate, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) CreateWebhook added in v0.2.0

func (q *Queries) CreateWebhook(ctx context.Context, arg CreateWebhookParams) (Webhook, error)

func (*Queries) DeleteBackupCodes added in v0.2.0

func (q *Queries) DeleteBackupCodes(ctx context.Context, userID int64) error

func (*Queries) DeleteBackupTarget added in v0.2.0

func (q *Queries) DeleteBackupTarget(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteEventsBefore

func (q *Queries) DeleteEventsBefore(ctx context.Context, ts int64) (int64, error)

func (*Queries) DeleteEventsBeyond

func (q *Queries) DeleteEventsBeyond(ctx context.Context, keep int64) (int64, error)

Keeps the newest @keep events.

func (*Queries) DeleteExpiredSessions

func (q *Queries) DeleteExpiredSessions(ctx context.Context, arg DeleteExpiredSessionsParams) (int64, error)

func (*Queries) DeleteGitCredential added in v0.2.0

func (q *Queries) DeleteGitCredential(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteGitHostKeys added in v0.2.0

func (q *Queries) DeleteGitHostKeys(ctx context.Context, host string) (int64, error)

func (*Queries) DeleteGitStack added in v0.2.0

func (q *Queries) DeleteGitStack(ctx context.Context, name string) (int64, error)

func (*Queries) DeleteNotificationChannel added in v0.2.0

func (q *Queries) DeleteNotificationChannel(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteOtherUserSessions

func (q *Queries) DeleteOtherUserSessions(ctx context.Context, arg DeleteOtherUserSessionsParams) (int64, error)

func (*Queries) DeletePasskey added in v0.2.0

func (q *Queries) DeletePasskey(ctx context.Context, arg DeletePasskeyParams) (int64, error)

func (*Queries) DeleteSchedule added in v0.2.0

func (q *Queries) DeleteSchedule(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, tokenHash []byte) (int64, error)

func (*Queries) DeleteSetting

func (q *Queries) DeleteSetting(ctx context.Context, key string) (int64, error)

func (*Queries) DeleteStack

func (q *Queries) DeleteStack(ctx context.Context, name string) (int64, error)

func (*Queries) DeleteStackTemplate added in v0.2.0

func (q *Queries) DeleteStackTemplate(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteStackVariables added in v0.2.0

func (q *Queries) DeleteStackVariables(ctx context.Context, stack string) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteUserAPIKey

func (q *Queries) DeleteUserAPIKey(ctx context.Context, arg DeleteUserAPIKeyParams) (int64, error)

func (*Queries) DeleteUserPasskeys added in v0.2.0

func (q *Queries) DeleteUserPasskeys(ctx context.Context, userID int64) error

func (*Queries) DeleteUserSessions

func (q *Queries) DeleteUserSessions(ctx context.Context, userID int64) (int64, error)

func (*Queries) DeleteVariable added in v0.2.0

func (q *Queries) DeleteVariable(ctx context.Context, arg DeleteVariableParams) (int64, error)

func (*Queries) DeleteWebhook added in v0.2.0

func (q *Queries) DeleteWebhook(ctx context.Context, id int64) (int64, error)

func (*Queries) DisableMFA added in v0.2.0

func (q *Queries) DisableMFA(ctx context.Context, arg DisableMFAParams) (int64, error)

func (*Queries) EnableMFA added in v0.2.0

func (q *Queries) EnableMFA(ctx context.Context, arg EnableMFAParams) (int64, error)

func (*Queries) FailUnfinishedScheduleRuns added in v0.2.0

func (q *Queries) FailUnfinishedScheduleRuns(ctx context.Context, now int64) error

func (*Queries) FinishScheduleRun added in v0.2.0

func (q *Queries) FinishScheduleRun(ctx context.Context, arg FinishScheduleRunParams) error

func (*Queries) GetAPIKeyWithUser

func (q *Queries) GetAPIKeyWithUser(ctx context.Context, tokenHash []byte) (GetAPIKeyWithUserRow, error)

func (*Queries) GetBackupTarget added in v0.2.0

func (q *Queries) GetBackupTarget(ctx context.Context, id int64) (BackupTarget, error)

func (*Queries) GetGitCredential added in v0.2.0

func (q *Queries) GetGitCredential(ctx context.Context, id int64) (GitCredential, error)

func (*Queries) GetGitStack added in v0.2.0

func (q *Queries) GetGitStack(ctx context.Context, name string) (GitStack, error)

func (*Queries) GetGitStackByWebhook added in v0.2.0

func (q *Queries) GetGitStackByWebhook(ctx context.Context, webhookHash string) (GitStack, error)

func (*Queries) GetNotificationChannel added in v0.2.0

func (q *Queries) GetNotificationChannel(ctx context.Context, id int64) (NotificationChannel, error)

func (*Queries) GetSchedule added in v0.2.0

func (q *Queries) GetSchedule(ctx context.Context, id int64) (Schedule, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, tokenHash []byte) (Session, error)

func (*Queries) GetSessionWithUser

func (q *Queries) GetSessionWithUser(ctx context.Context, tokenHash []byte) (GetSessionWithUserRow, error)

func (*Queries) GetSetting

func (q *Queries) GetSetting(ctx context.Context, key string) (string, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) GetStack

func (q *Queries) GetStack(ctx context.Context, name string) (Stack, error)

func (*Queries) GetStackTemplate added in v0.2.0

func (q *Queries) GetStackTemplate(ctx context.Context, id int64) (StackTemplate, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error)

func (*Queries) GetUserByOIDCIdentity added in v0.2.0

func (q *Queries) GetUserByOIDCIdentity(ctx context.Context, oidcIdentity sql.NullString) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) GetUserByWebAuthnHandle added in v0.2.0

func (q *Queries) GetUserByWebAuthnHandle(ctx context.Context, webauthnHandle []byte) (User, error)

func (*Queries) GetUserPreferences

func (q *Queries) GetUserPreferences(ctx context.Context, userID int64) (string, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) GetVariable added in v0.2.0

func (q *Queries) GetVariable(ctx context.Context, arg GetVariableParams) (Variable, error)

func (*Queries) GetWebhook added in v0.2.0

func (q *Queries) GetWebhook(ctx context.Context, id int64) (Webhook, error)

func (*Queries) GetWebhookByToken added in v0.2.0

func (q *Queries) GetWebhookByToken(ctx context.Context, tokenHash string) (Webhook, error)

func (*Queries) InsertAudit added in v0.2.0

func (q *Queries) InsertAudit(ctx context.Context, arg InsertAuditParams) error

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) InsertEvent

func (q *Queries) InsertEvent(ctx context.Context, arg InsertEventParams) error

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) InsertScheduleRun added in v0.2.0

func (q *Queries) InsertScheduleRun(ctx context.Context, arg InsertScheduleRunParams) (int64, error)

func (*Queries) LastAutoUpdate added in v0.2.0

func (q *Queries) LastAutoUpdate(ctx context.Context, arg LastAutoUpdateParams) (AutoUpdate, error)

func (*Queries) LastImageUpdateCheck added in v0.1.1

func (q *Queries) LastImageUpdateCheck(ctx context.Context, environment string) (int64, error)

func (*Queries) ListAudit added in v0.2.0

func (q *Queries) ListAudit(ctx context.Context, arg ListAuditParams) ([]AuditLog, error)

Newest first, before an id for paging; q matches path, object, action, message and user.

func (*Queries) ListAutoUpdates added in v0.2.0

func (q *Queries) ListAutoUpdates(ctx context.Context, arg ListAutoUpdatesParams) ([]AutoUpdate, error)

func (*Queries) ListBackupTargets added in v0.2.0

func (q *Queries) ListBackupTargets(ctx context.Context) ([]BackupTarget, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListEvents

func (q *Queries) ListEvents(ctx context.Context, arg ListEventsParams) ([]Event, error)

Newest first, before the cursor id (0 = from the newest). Empty filters match everything.

func (*Queries) ListGitCredentials added in v0.2.0

func (q *Queries) ListGitCredentials(ctx context.Context) ([]GitCredential, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListGitHostKeys added in v0.2.0

func (q *Queries) ListGitHostKeys(ctx context.Context, host string) ([]string, error)

func (*Queries) ListGitKnownHosts added in v0.2.0

func (q *Queries) ListGitKnownHosts(ctx context.Context) ([]GitKnownHost, error)

func (*Queries) ListGitStacks added in v0.2.0

func (q *Queries) ListGitStacks(ctx context.Context) ([]GitStack, error)

func (*Queries) ListImageUpdates added in v0.1.1

func (q *Queries) ListImageUpdates(ctx context.Context, environment string) ([]ImageUpdate, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListNotificationChannels added in v0.2.0

func (q *Queries) ListNotificationChannels(ctx context.Context) ([]NotificationChannel, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListPasskeys added in v0.2.0

func (q *Queries) ListPasskeys(ctx context.Context, userID int64) ([]Passkey, error)

func (*Queries) ListScheduleRuns added in v0.2.0

func (q *Queries) ListScheduleRuns(ctx context.Context, arg ListScheduleRunsParams) ([]ScheduleRun, error)

func (*Queries) ListSchedules added in v0.2.0

func (q *Queries) ListSchedules(ctx context.Context) ([]Schedule, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListSettings

func (q *Queries) ListSettings(ctx context.Context) ([]Setting, error)

func (*Queries) ListStackTemplates added in v0.2.0

func (q *Queries) ListStackTemplates(ctx context.Context) ([]StackTemplate, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListStacks

func (q *Queries) ListStacks(ctx context.Context) ([]Stack, error)

func (*Queries) ListUserAPIKeys

func (q *Queries) ListUserAPIKeys(ctx context.Context, userID int64) ([]ApiKey, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) ListVariables added in v0.2.0

func (q *Queries) ListVariables(ctx context.Context, stack string) ([]Variable, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) ListWebhooks added in v0.2.0

func (q *Queries) ListWebhooks(ctx context.Context) ([]Webhook, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) PruneAudit added in v0.2.0

func (q *Queries) PruneAudit(ctx context.Context, before int64) (int64, error)

func (*Queries) PruneAutoUpdates added in v0.2.0

func (q *Queries) PruneAutoUpdates(ctx context.Context, arg PruneAutoUpdatesParams) error

func (*Queries) PruneScheduleRuns added in v0.2.0

func (q *Queries) PruneScheduleRuns(ctx context.Context, arg PruneScheduleRunsParams) error

func (*Queries) PutVariable added in v0.2.0

func (q *Queries) PutVariable(ctx context.Context, arg PutVariableParams) error

func (*Queries) RegisterStack

func (q *Queries) RegisterStack(ctx context.Context, arg RegisterStackParams) error

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only

func (*Queries) SetAuditJobResult added in v0.2.0

func (q *Queries) SetAuditJobResult(ctx context.Context, arg SetAuditJobResultParams) error

func (*Queries) SetGitStackAuto added in v0.2.0

func (q *Queries) SetGitStackAuto(ctx context.Context, arg SetGitStackAutoParams) (int64, error)

func (*Queries) SetGitStackChecked added in v0.2.0

func (q *Queries) SetGitStackChecked(ctx context.Context, arg SetGitStackCheckedParams) error

func (*Queries) SetGitStackCommit added in v0.2.0

func (q *Queries) SetGitStackCommit(ctx context.Context, arg SetGitStackCommitParams) error

func (*Queries) SetGitStackError added in v0.2.0

func (q *Queries) SetGitStackError(ctx context.Context, arg SetGitStackErrorParams) error

func (*Queries) SetGitStackWebhook added in v0.2.0

func (q *Queries) SetGitStackWebhook(ctx context.Context, arg SetGitStackWebhookParams) (int64, error)

func (*Queries) SetImageUpdate added in v0.1.1

func (q *Queries) SetImageUpdate(ctx context.Context, arg SetImageUpdateParams) error

A failed check keeps the last digest and when it was first seen (#56); a new digest restarts seen_at.

func (*Queries) SetMFASecret added in v0.2.0

func (q *Queries) SetMFASecret(ctx context.Context, arg SetMFASecretParams) (int64, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only Starts (or restarts) enrollment; MFA stays off until confirmed.

func (*Queries) SetNotificationResult added in v0.2.0

func (q *Queries) SetNotificationResult(ctx context.Context, arg SetNotificationResultParams) error

func (*Queries) SetScheduleLastRun added in v0.2.0

func (q *Queries) SetScheduleLastRun(ctx context.Context, arg SetScheduleLastRunParams) error

func (*Queries) SetScheduleRunJob added in v0.2.0

func (q *Queries) SetScheduleRunJob(ctx context.Context, arg SetScheduleRunJobParams) error

func (*Queries) SetSetting

func (q *Queries) SetSetting(ctx context.Context, arg SetSettingParams) error

func (*Queries) SetUserDisabled

func (q *Queries) SetUserDisabled(ctx context.Context, arg SetUserDisabledParams) (int64, error)

func (*Queries) SetUserLastLogin

func (q *Queries) SetUserLastLogin(ctx context.Context, arg SetUserLastLoginParams) (int64, error)

func (*Queries) SetUserOIDCIdentity added in v0.2.0

func (q *Queries) SetUserOIDCIdentity(ctx context.Context, arg SetUserOIDCIdentityParams) (int64, error)

func (*Queries) SetUserPreferences

func (q *Queries) SetUserPreferences(ctx context.Context, arg SetUserPreferencesParams) error

func (*Queries) SetWebAuthnHandle added in v0.2.0

func (q *Queries) SetWebAuthnHandle(ctx context.Context, arg SetWebAuthnHandleParams) (int64, error)

SPDX-FileCopyrightText: 2026 The nerdui Authors SPDX-License-Identifier: AGPL-3.0-only Sets the user handle once; a user keeps it for all their passkeys.

func (*Queries) SetWebhookCalled added in v0.2.0

func (q *Queries) SetWebhookCalled(ctx context.Context, arg SetWebhookCalledParams) error

func (*Queries) SetWebhookToken added in v0.2.0

func (q *Queries) SetWebhookToken(ctx context.Context, arg SetWebhookTokenParams) (int64, error)

func (*Queries) TouchAPIKey

func (q *Queries) TouchAPIKey(ctx context.Context, arg TouchAPIKeyParams) (int64, error)

func (*Queries) TouchSession

func (q *Queries) TouchSession(ctx context.Context, arg TouchSessionParams) (int64, error)

func (*Queries) UpdateBackupTarget added in v0.2.0

func (q *Queries) UpdateBackupTarget(ctx context.Context, arg UpdateBackupTargetParams) (BackupTarget, error)

func (*Queries) UpdateGitCredential added in v0.2.0

func (q *Queries) UpdateGitCredential(ctx context.Context, arg UpdateGitCredentialParams) (GitCredential, error)

func (*Queries) UpdateNotificationChannel added in v0.2.0

func (q *Queries) UpdateNotificationChannel(ctx context.Context, arg UpdateNotificationChannelParams) (NotificationChannel, error)

func (*Queries) UpdatePasskeyUse added in v0.2.0

func (q *Queries) UpdatePasskeyUse(ctx context.Context, arg UpdatePasskeyUseParams) (int64, error)

func (*Queries) UpdateSchedule added in v0.2.0

func (q *Queries) UpdateSchedule(ctx context.Context, arg UpdateScheduleParams) (Schedule, error)

func (*Queries) UpdateStackTemplate added in v0.2.0

func (q *Queries) UpdateStackTemplate(ctx context.Context, arg UpdateStackTemplateParams) (StackTemplate, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (int64, error)

func (*Queries) UpdateWebhook added in v0.2.0

func (q *Queries) UpdateWebhook(ctx context.Context, arg UpdateWebhookParams) (Webhook, error)

func (*Queries) UseBackupCode added in v0.2.0

func (q *Queries) UseBackupCode(ctx context.Context, arg UseBackupCodeParams) (int64, error)

func (*Queries) UseMFAStep added in v0.2.0

func (q *Queries) UseMFAStep(ctx context.Context, arg UseMFAStepParams) (int64, error)

Accepts a TOTP step only once and only forward.

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RegisterStackParams

type RegisterStackParams struct {
	Name string
	Path string
	Mode string
	Now  int64
}

type Schedule added in v0.2.0

type Schedule struct {
	ID          int64
	Name        string
	Kind        string
	Environment string
	Namespace   string
	Target      string
	Options     string
	Secret      string
	Cron        string
	Enabled     int64
	CreatedBy   string
	CreatedAt   int64
	UpdatedAt   int64
	LastRunAt   int64
	LastStatus  string
	LastMessage string
}

type ScheduleRun added in v0.2.0

type ScheduleRun struct {
	ID         int64
	ScheduleID int64
	Trigger    string
	StartedAt  int64
	FinishedAt int64
	Status     string
	Message    string
	JobID      string
}

type Session

type Session struct {
	TokenHash  []byte
	UserID     int64
	CsrfToken  string
	CreatedAt  int64
	LastSeenAt int64
	ExpiresAt  int64
	ClientIp   string
	UserAgent  string
	Method     string
}

type SetAuditJobResultParams added in v0.2.0

type SetAuditJobResultParams struct {
	Result  string
	Message string
	JobID   string
}

type SetGitStackAutoParams added in v0.2.0

type SetGitStackAutoParams struct {
	AutoUpdate   string
	PollInterval int64
	Name         string
}

type SetGitStackCheckedParams added in v0.2.0

type SetGitStackCheckedParams struct {
	Now        int64
	RemoteHash string
	Error      string
	Name       string
}

type SetGitStackCommitParams added in v0.2.0

type SetGitStackCommitParams struct {
	CommitHash    string
	CommitMessage string
	CommitAuthor  string
	CommitAt      int64
	Now           int64
	Name          string
}

type SetGitStackErrorParams added in v0.2.0

type SetGitStackErrorParams struct {
	Error string
	Name  string
}

type SetGitStackWebhookParams added in v0.2.0

type SetGitStackWebhookParams struct {
	WebhookHash string
	Name        string
}

type SetImageUpdateParams added in v0.1.1

type SetImageUpdateParams struct {
	Environment  string
	Ref          string
	RemoteDigest string
	Error        string
	CheckedAt    int64
}

type SetMFASecretParams added in v0.2.0

type SetMFASecretParams struct {
	Secret string
	Now    int64
	ID     int64
}

type SetNotificationResultParams added in v0.2.0

type SetNotificationResultParams struct {
	SentAt int64
	Error  string
	ID     int64
}

type SetScheduleLastRunParams added in v0.2.0

type SetScheduleLastRunParams struct {
	LastRunAt   int64
	LastStatus  string
	LastMessage string
	ID          int64
}

type SetScheduleRunJobParams added in v0.2.0

type SetScheduleRunJobParams struct {
	JobID string
	ID    int64
}

type SetSettingParams

type SetSettingParams struct {
	Key   string
	Value string
	Now   int64
}

type SetUserDisabledParams

type SetUserDisabledParams struct {
	DisabledAt sql.NullInt64
	Now        int64
	ID         int64
}

type SetUserLastLoginParams

type SetUserLastLoginParams struct {
	Now sql.NullInt64
	ID  int64
}

type SetUserOIDCIdentityParams added in v0.2.0

type SetUserOIDCIdentityParams struct {
	OidcIdentity sql.NullString
	Now          int64
	ID           int64
}

type SetUserPreferencesParams

type SetUserPreferencesParams struct {
	UserID int64
	Data   string
	Now    int64
}

type SetWebAuthnHandleParams added in v0.2.0

type SetWebAuthnHandleParams struct {
	Handle []byte
	ID     int64
}

type SetWebhookCalledParams added in v0.2.0

type SetWebhookCalledParams struct {
	Now       int64
	LastJob   string
	LastError string
	ID        int64
}

type SetWebhookTokenParams added in v0.2.0

type SetWebhookTokenParams struct {
	TokenHash string
	Now       int64
	ID        int64
}

type Setting

type Setting struct {
	Key       string
	Value     string
	UpdatedAt int64
}

type Stack

type Stack struct {
	Name      string
	Path      string
	Mode      string
	CreatedAt int64
}

type StackTemplate added in v0.2.0

type StackTemplate struct {
	ID          int64
	Name        string
	Description string
	Compose     string
	Env         string
	CreatedBy   string
	CreatedAt   int64
	UpdatedAt   int64
}

type TouchAPIKeyParams

type TouchAPIKeyParams struct {
	Now sql.NullInt64
	ID  int64
}

type TouchSessionParams

type TouchSessionParams struct {
	Now       int64
	TokenHash []byte
}

type UpdateBackupTargetParams added in v0.2.0

type UpdateBackupTargetParams struct {
	Name    string
	Kind    string
	Options string
	Secret  string
	Now     int64
	ID      int64
}

type UpdateGitCredentialParams added in v0.2.0

type UpdateGitCredentialParams struct {
	Name       string
	Kind       string
	Username   string
	Secret     string
	Passphrase string
	Now        int64
	ID         int64
}

type UpdateNotificationChannelParams added in v0.2.0

type UpdateNotificationChannelParams struct {
	Name    string
	Type    string
	Config  string
	Events  string
	Enabled int64
	Now     int64
	ID      int64
}

type UpdatePasskeyUseParams added in v0.2.0

type UpdatePasskeyUseParams struct {
	Credential string
	Now        sql.NullInt64
	ID         int64
}

type UpdateScheduleParams added in v0.2.0

type UpdateScheduleParams struct {
	Name        string
	Kind        string
	Environment string
	Namespace   string
	Target      string
	Options     string
	Secret      string
	Cron        string
	Enabled     int64
	Now         int64
	ID          int64
}

type UpdateStackTemplateParams added in v0.2.0

type UpdateStackTemplateParams struct {
	Name        string
	Description string
	Compose     string
	Env         string
	Now         int64
	ID          int64
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	PasswordHash       string
	MustChangePassword int64
	Now                int64
	ID                 int64
}

type UpdateWebhookParams added in v0.2.0

type UpdateWebhookParams struct {
	Name        string
	Environment string
	Namespace   string
	TargetKind  string
	Target      string
	Action      string
	Enabled     int64
	Now         int64
	ID          int64
}

type UseBackupCodeParams added in v0.2.0

type UseBackupCodeParams struct {
	UserID   int64
	CodeHash []byte
}

type UseMFAStepParams added in v0.2.0

type UseMFAStepParams struct {
	Step int64
	ID   int64
}

type User

type User struct {
	ID                 int64
	Username           string
	PasswordHash       string
	Role               string
	CreatedAt          int64
	UpdatedAt          int64
	DisabledAt         sql.NullInt64
	MustChangePassword int64
	LastLoginAt        sql.NullInt64
	MfaSecret          string
	MfaEnabled         int64
	MfaLastStep        int64
	OidcIdentity       sql.NullString
	WebauthnHandle     []byte
	PasskeyCount       int64
}

type UserPreference

type UserPreference struct {
	UserID    int64
	Data      string
	UpdatedAt int64
}

type Variable added in v0.2.0

type Variable struct {
	Stack     string
	Name      string
	Value     string
	Secret    int64
	UpdatedBy string
	UpdatedAt int64
}

type Webhook added in v0.2.0

type Webhook struct {
	ID           int64
	Name         string
	Environment  string
	Namespace    string
	TargetKind   string
	Target       string
	Action       string
	TokenHash    string
	Enabled      int64
	CreatedBy    string
	CreatedAt    int64
	UpdatedAt    int64
	LastCalledAt int64
	LastJob      string
	LastError    string
}

Jump to

Keyboard shortcuts

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