auth

package
v1.1.27 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

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) GetByUsername

func (repo *AuthRepository) GetByUsername(username string) (*AuthEntry, 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"`
}

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) GetByID

func (repo *PrivRepository) GetByID(id int64) ([]*PrivilegeEntry, 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