dataaccess

package
v0.0.0-...-d894a7c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSession

func ClearSession() error

func DeleteKrankenfahrt

func DeleteKrankenfahrt(id int) error

func DeleteUser

func DeleteUser(login string) error

func UndoAcceptKrankenfahrt

func UndoAcceptKrankenfahrt(fahrt Krankenfahrt) error

func UpdateKrankenfahrt

func UpdateKrankenfahrt(fahrt Krankenfahrt) error

Types

type Krankenfahrt

type Krankenfahrt struct {
	Id              int
	Description     string
	CreatedAt       time.Time
	AcceptedByLogin *string
	AcceptedAt      *time.Time
	Finished        bool
}

func CreateKrankenfahrt

func CreateKrankenfahrt(desc string) (Krankenfahrt, error)

func GetKrankenfahrt

func GetKrankenfahrt(id int) (Krankenfahrt, error)

func GetKrankenfahrten

func GetKrankenfahrten() ([]Krankenfahrt, error)

type Session

type Session struct {
	Token      string
	Login      string
	ExpiryDate time.Time
}

func CreateSession

func CreateSession(token string, login string) (Session, error)

func GetSession

func GetSession(session string) (Session, error)

func GetSessions

func GetSessions() ([]Session, error)

type User

type User struct {
	Id           uint
	Login        string
	PasswordHash string
	Admin        bool
}

func CreateUser

func CreateUser(login string, password string, admin bool) (User, error)

func GetUser

func GetUser(login string) (User, error)

func GetUserById

func GetUserById(id int) (User, error)

func GetUsers

func GetUsers() ([]User, error)

Jump to

Keyboard shortcuts

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