db

package
v0.0.0-...-204aec8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Index *index.Index
	// contains filtered or unexported fields
}

func New

func New(cfg *core.Config) (db *DB, err error)

func NewPlain

func NewPlain(cfg *core.Config) (db *DB, err error)

func (*DB) Add

func (db *DB) Add(sig string, exp int64) error

func (*DB) AdminUpdateUser

func (db *DB) AdminUpdateUser(username, password string, admin bool) error

func (*DB) Check

func (db *DB) Check(sig string) (ok bool)

func (*DB) Close

func (db *DB) Close() (err error)

func (*DB) CreatePage

func (db *DB) CreatePage(title, section, markdown, username string, p core.Permission) (page *core.Page, err error)

func (*DB) CreateSection

func (db *DB) CreateSection(section string, members []string, user bool) error

func (*DB) CreateUser

func (db *DB) CreateUser(username, password string, admin bool) error

func (*DB) DeletePage

func (db *DB) DeletePage(title, section, username string) (err error)

func (*DB) DeleteSection

func (db *DB) DeleteSection(section string) error

func (*DB) DeleteUser

func (db *DB) DeleteUser(username string) error

func (*DB) Dump

func (db *DB) Dump(w io.Writer) error

func (*DB) GetAllSectionPages

func (db *DB) GetAllSectionPages(section, username string, admin bool) (pages core.Pages, err error)

func (*DB) GetAllSections

func (db *DB) GetAllSections(username string, admin bool) (sections core.SectionPages)

func (*DB) GetPage

func (db *DB) GetPage(section, title, username string) (p *core.Page, err error)

func (*DB) GetSection

func (db *DB) GetSection(section string) (s core.Section, err error)

func (*DB) GetSections

func (db *DB) GetSections() (secs core.Sections, err error)

func (*DB) GetUser

func (db *DB) GetUser(username string) (u *core.User, err error)

func (*DB) GetUserSecret

func (db *DB) GetUserSecret(username string) (secret string, err error)

func (*DB) GetUserSections

func (db *DB) GetUserSections(username string) (sections map[string]bool, err error)

func (*DB) GetUserWithoutPassword

func (db *DB) GetUserWithoutPassword(username string) (u *core.User, err error)

func (*DB) GetUsers

func (db *DB) GetUsers() (users core.Users, err error)

func (*DB) LockedOut

func (db *DB) LockedOut(username, created string) bool

func (*DB) Login

func (db *DB) Login(username, password string) (u *core.User, err error)

func (*DB) Map

func (db *DB) Map() (list jwt.BlacklistMap, err error)

func (*DB) ReadPerm

func (db *DB) ReadPerm(st, username string, p core.Permission) bool

func (*DB) Remove

func (db *DB) Remove(sig string) error

func (*DB) ResetAdmin

func (db *DB) ResetAdmin() error

func (*DB) Restore

func (db *DB) Restore(r io.Reader) (err error)

func (*DB) RunMigrations

func (db *DB) RunMigrations() (err error)

func (*DB) SectionExists

func (db *DB) SectionExists(section string) error

func (*DB) Totp

func (db *DB) Totp(username, pin string) (u *core.User, err error)

func (*DB) UnlockUser

func (db *DB) UnlockUser(username string) (err error)

func (*DB) UpdatePage

func (db *DB) UpdatePage(title, section, markdown, username string, p core.Permission) (err error)

func (*DB) UpdateSection

func (db *DB) UpdateSection(section string, members []string, user bool) error

func (*DB) UpdateUserPassword

func (db *DB) UpdateUserPassword(username, password string) error

func (*DB) UpdateUserSecret

func (db *DB) UpdateUserSecret(username, secret string) error

func (*DB) UserExists

func (db *DB) UserExists(username string) error

func (*DB) ValidatePage

func (db *DB) ValidatePage(st, username string) bool

func (*DB) WritePerm

func (db *DB) WritePerm(st, username string, p core.Permission) bool

Jump to

Keyboard shortcuts

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