repo

package
v0.0.0-...-6771441 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClassNotFoundError    = errors.New("Class not found")
	ClassFullError        = errors.New("Class is full")
	InvalidDateRangeError = errors.New("No class is available on the given date")
)

Functions

func MigrateUp

func MigrateUp(db *sql.DB) error

Types

type Repo

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

func New

func New(db *sql.DB) (*Repo, error)

func (*Repo) CreateBooking

func (r *Repo) CreateBooking(ctx context.Context, classID uint64, memberName string, date int64) error

'date' is in UNIX timestamp format

func (*Repo) CreateClass

func (r *Repo) CreateClass(ctx context.Context, name string, startDate int64, endDate int64, capacity uint) error

'startDate' and 'endDate' are in UNIX timestamp format

Jump to

Keyboard shortcuts

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