db

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertAccount

func InsertAccount(ctx context.Context, pool *pgxpool.Pool, name, role, hashedPassword, tenant, email string) (int, error)

func LoadAccountIdByEmail added in v0.0.14

func LoadAccountIdByEmail(ctx context.Context, pool *pgxpool.Pool, email string) (int, error)

func LoadAccountIdByName added in v0.0.14

func LoadAccountIdByName(ctx context.Context, pool *pgxpool.Pool, name string) (int, error)

func LogEvent added in v0.0.14

func LogEvent(ctx context.Context, pool *pgxpool.Pool, kind Kind, accountId int, infoKey, infoVal string)

func UpdatePassword

func UpdatePassword(ctx context.Context, pool *pgxpool.Pool, name, password string) error

Types

type Account

type Account struct {
	Id         int
	Name       string
	Role       string
	Registered time.Time
	Password   string
	Tenant     string
	Email      string
}

func LoadAccountByName

func LoadAccountByName(ctx context.Context, pool *pgxpool.Pool, name string) (*Account, error)

type Kind added in v0.0.14

type Kind string
const (
	ACCOUNT_CREATED    Kind = "account_created"
	ACCOUNT_DELETED    Kind = "account_deleted"
	LOGIN_SUCCESS      Kind = "login_success"
	LOGIN_FAILURE      Kind = "login_failure"
	INSTANCE_START     Kind = "instance_start"
	INSTANCE_STOP      Kind = "instance_stop"
	PASSWORD_REQUESTED Kind = "password_requested"
	PASSWORD_RESET     Kind = "password_reset"
)

Jump to

Keyboard shortcuts

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