database

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAPIKey added in v0.4.0

func AddAPIKey(db *sql.DB, key token.APIKey) error

func AddServiceKey added in v0.4.0

func AddServiceKey(db *sql.DB, key token.ServiceKey) error

func CreateUserWithEmailAndPasswordHash added in v0.4.0

func CreateUserWithEmailAndPasswordHash(db *sql.DB, email string, passwordhash string) (bool, error)

func GenerateAccessToken added in v0.4.0

func GenerateAccessToken(user *token.User, db *sql.DB, auth *token.AuthService) (string, error)

func GetAllAPIKeys added in v0.4.0

func GetAllAPIKeys(db *sql.DB) ([]token.APIKey, error)

func GetAllServiceKeys added in v0.4.0

func GetAllServiceKeys(db *sql.DB) ([]token.ServiceKey, error)

func GetAllUsers added in v0.4.0

func GetAllUsers(db *sql.DB) ([]*token.User, error)

func GetEntitiesForUser added in v0.7.1

func GetEntitiesForUser(entity Entity, db *sql.DB, userID string) ([]int, error)

func GetUserByEmail added in v0.4.0

func GetUserByEmail(db *sql.DB, email string) (*token.User, error)

func GetUserByID added in v0.4.0

func GetUserByID(db *sql.DB, userID string) (*token.User, error)

func RegenerateAccessToken added in v0.4.0

func RegenerateAccessToken(user *token.User, oldClaims *token.UserClaims, db *sql.DB, auth *token.AuthService) (string, error)

func RemoveAPIKey added in v0.4.0

func RemoveAPIKey(db *sql.DB, keyID string) error

func RemoveEntityForUser added in v0.7.1

func RemoveEntityForUser(entity Entity, db *sql.DB, objectID string, userID string) (bool, error)

func RemoveServiceKey added in v0.4.0

func RemoveServiceKey(db *sql.DB, keyID string) error

func SetEntityForUser added in v0.7.1

func SetEntityForUser(entity Entity, db *sql.DB, objectID string, userID string) (bool, error)

func SetPasswordForUser added in v0.4.0

func SetPasswordForUser(db *sql.DB, userID string, newpasswordhash string) (bool, error)

func SetRoleForUser added in v0.4.0

func SetRoleForUser(db *sql.DB, userID string, newUserRole int) (bool, error)

func UpdateAPIKey added in v0.4.0

func UpdateAPIKey(db *sql.DB, key token.APIKey) error

func UpdateServiceKey added in v0.4.0

func UpdateServiceKey(db *sql.DB, key token.ServiceKey) error

Types

type Entity added in v0.7.1

type Entity string
const (
	Festival Entity = "festival"
	Artist   Entity = "artist"
	Location Entity = "location"
	Event    Entity = "event"
	Link     Entity = "link"
	Image    Entity = "image"
	Place    Entity = "place"
	Tag      Entity = "tag"
)

Jump to

Keyboard shortcuts

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