database

package
v0.0.0-...-a9e4aaf Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorMD5Exists      = errors.New("file hash already exists")
	ErrorFileNameExists = errors.New("filename already exists")
)

Functions

This section is empty.

Types

type Database

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

Database : database type

func InitSQL

func InitSQL(config config.Config) Database

InitSQL : MySQL Initializer

func (Database) CreateAdmin

func (m Database) CreateAdmin(username, hashpass string) error

func (Database) CreateFileInDB

func (m Database) CreateFileInDB(file, md5, endp string, verified, nsfw bool) error

func (Database) DeleteFile

func (m Database) DeleteFile(filename string) error

func (Database) GetAdminHash

func (m Database) GetAdminHash(username string) (string, error)

func (Database) GetFiles

func (m Database) GetFiles(endpoint string, nsfw bool, notIN []string, limit int) ([]string, error)

func (Database) GetFilesAdmin

func (m Database) GetFilesAdmin(endp, query string, verified, nsfw bool) ([]string, error)

GetFilesAdmin : get files for specified endpoint admin

func (Database) VerifyFile

func (m Database) VerifyFile(filename string) error

Jump to

Keyboard shortcuts

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