db

package
v2.0.1-0...-5e4f78d Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ban

type Ban struct {
	Name string `json:"name"`
}

type Database

type Database struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func New

func New(path string) (*Database, error)

func (*Database) AddBan

func (db *Database) AddBan(name string) error

func (*Database) AddUser

func (db *Database) AddUser(name string, pubkey string, override bool) error

func (*Database) DelBan

func (db *Database) DelBan(name string) error

func (*Database) DelUser

func (db *Database) DelUser(name string) error

func (*Database) GetPublicKey

func (db *Database) GetPublicKey(name string) (pubkey string, err error)

func (*Database) IsBanned

func (db *Database) IsBanned(name string) (bool, error)

func (*Database) UpdateUserLastAuthed

func (db *Database) UpdateUserLastAuthed(name string) error

type User

type User struct {
	Name      string `json:"name"`
	PublicKey string `json:"public_key"`
}

type UserExistsError

type UserExistsError User

func (UserExistsError) Error

func (e UserExistsError) Error() string

type UserNotFoundError

type UserNotFoundError string

func (UserNotFoundError) Error

func (e UserNotFoundError) Error() string

Jump to

Keyboard shortcuts

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