database

package
v0.0.0-...-77674a3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New(filename string) (Database, error)

func (Database) CreateUser

func (d Database) CreateUser(username, passwordHash, roles string) *User

func (Database) GetSetting

func (d Database) GetSetting(name string) string

func (Database) GetUserByName

func (d Database) GetUserByName(username string) *User

func (Database) HasUsers

func (d Database) HasUsers() bool

func (Database) SaveSetting

func (d Database) SaveSetting(name, value string) string

type User

type User struct {
	gorm.Model
	Name         string `gorm:"uniqueIndex"`
	PasswordHash string
	Roles        string
}

func (*User) HasRole

func (u *User) HasRole(role string) bool

Jump to

Keyboard shortcuts

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