auth

package
v1.1.47 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LastLogin  OrderColumnType    = "last_login"
	Name       OrderColumnType    = "name"
	Ascending  OrderDirectionType = "asc"
	Descending OrderDirectionType = "desc"
)

Variables

This section is empty.

Functions

func MigrateAuthDB

func MigrateAuthDB(db *sql.DB, dbtype types.DatabaseType) error

Types

type AuthEntry

type AuthEntry struct {
	ID        *int64 `json:"id"`
	Name      string `json:"name"`
	Password  string `json:"password"`
	LastLogin int    `json:"last_login"`
}

type AuthRepository

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

func NewAuthRepository

func NewAuthRepository(db *sql.DB, dbtype types.DatabaseType) *AuthRepository

func (*AuthRepository) Count

func (repo *AuthRepository) Count(s *AuthSearch) (int, error)

func (*AuthRepository) Create

func (repo *AuthRepository) Create(entry *AuthEntry) error

func (*AuthRepository) Delete

func (repo *AuthRepository) Delete(id int64) error

func (*AuthRepository) DeleteAll added in v1.1.37

func (repo *AuthRepository) DeleteAll() error

func (*AuthRepository) Export added in v1.1.37

func (repo *AuthRepository) Export(z *zip.Writer) error

func (*AuthRepository) GetByUsername

func (repo *AuthRepository) GetByUsername(username string) (*AuthEntry, error)

func (*AuthRepository) Import added in v1.1.37

func (repo *AuthRepository) Import(z *zip.Reader) error

func (*AuthRepository) Search

func (repo *AuthRepository) Search(s *AuthSearch) ([]*AuthEntry, error)

func (*AuthRepository) Update

func (repo *AuthRepository) Update(entry *AuthEntry) error

type AuthSearch

type AuthSearch struct {
	Usernamelike   *string             `json:"usernamelike"`
	Username       *string             `json:"username"`
	Limit          *int                `json:"limit"`
	OrderColumn    *OrderColumnType    `json:"order_column"`
	OrderDirection *OrderDirectionType `json:"order_direction"`
}

type OrderColumnType added in v1.1.28

type OrderColumnType string

type OrderDirectionType added in v1.1.28

type OrderDirectionType string

type PrivRepository

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

func NewPrivilegeRepository

func NewPrivilegeRepository(db *sql.DB, dbtype types.DatabaseType) *PrivRepository

func (*PrivRepository) Create

func (repo *PrivRepository) Create(entry *PrivilegeEntry) error

func (*PrivRepository) Delete

func (repo *PrivRepository) Delete(id int64, privilege string) error

func (*PrivRepository) Export added in v1.1.37

func (repo *PrivRepository) Export(z *zip.Writer) error

func (*PrivRepository) GetByID

func (repo *PrivRepository) GetByID(id int64) ([]*PrivilegeEntry, error)

func (*PrivRepository) Import added in v1.1.37

func (repo *PrivRepository) Import(z *zip.Reader) error

type PrivilegeEntry

type PrivilegeEntry struct {
	ID        int64  `json:"id"`
	Privilege string `json:"privilege"`
}

Jump to

Keyboard shortcuts

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