users

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 13 Imported by: ? 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

func AddKey

func AddKey(creds *ApiCredentials, c Conf) (string, error)

AddKey adds an API key.

func AddUser

func AddUser(creds UserCredentials, c Conf) error

func InitUser

func InitUser(c Conf) error

InitUser adds a user with username "admin" and password "admin" if no users exist.

func RemoveKey

func RemoveKey(creds *ApiCredentials, c Conf) error

RemoveKey removes an API key.

func RemoveUser

func RemoveUser(creds *UserCredentials, conn *sqlite.Conn) error

RemoveUser removes a user from the database.

func RemoveUserConnect

func RemoveUserConnect(creds *UserCredentials, c Conf) error

func ResetUsers

func ResetUsers(c Conf) error

ResetUsers removes all users and creates an account with username 'admin' and password 'admin'.

func ValidateCredentials added in v0.0.9

func ValidateCredentials(creds UserCredentials) error

ValidateCredentials checks new users regardless of their input format.

Types

type ApiCredentials

type ApiCredentials = types.ApiCredentials

func GetKeyNames

func GetKeyNames(c Conf) ([]ApiCredentials, error)

GetKeyNames returns a list of all API key names.

type Conf

type Conf = types.Conf

type User

type User = types.User

func ListUsers

func ListUsers(c Conf) ([]User, error)

ListUsers lists all users.

type UserCredentials

type UserCredentials = types.UserCredentials

func GetUser

func GetUser(creds *UserCredentials, c Conf) (UserCredentials, error)

Jump to

Keyboard shortcuts

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