database

package
v0.0.0-...-8094d75 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DatabaseType = "sqlite3"

DatabaseType describes the Database which is used

Variables

This section is empty.

Functions

func AccessLimitExceeded

func AccessLimitExceeded(ip string, endpoint string, maxPerMinute int, maxPerHour int) (bool, error)

AccessLimitExceeded checks a max access count for a specific ip and endpoint in 60 seconds

func AccessLog

func AccessLog(ip string, endpoint string) error

AccessLog creates an access log entry for an endpoint with the ip address of the requester

func Login

func Login(loginRequest structs.LoginRequest) ([]byte, error)

Login checks the login against the database

func SetupDatabase

func SetupDatabase()

SetupDatabase Creates the database if there is no one

func UpdatePassword

func UpdatePassword(updateRequest structs.UpdatePasswordRequest) error

UpdatePassword changes the password for the given user with the given password

func UpdateUsername

func UpdateUsername(updateRequest structs.UpdateUsernameRequest) error

UpdateUsername changes the username for the given user with the given username

Types

This section is empty.

Jump to

Keyboard shortcuts

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