model

package
v0.0.0-...-42042a4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID          int64  `json:"id"`
	Title       string `json:"title" binding:"required"`
	Description string `json:"description" binding:"required"`
	Location    string `json:"location" binding:"required"`
	Organizer   string `json:"organizer" binding:"required"`
	// date and time
	DateTime     time.Time `json:"datetime" binding:"required"`
	CalendarWeek int       `json:"calendar_week"`
	Year         int       `json:"year"`
	// creator
	CreatorID int64 `json:"creator_id"`
}

Event is a struct which is returned to the client by the server

func GetAllEvents

func GetAllEvents() ([]Event, error)

func GetEventByID

func GetEventByID(eventID int64) (*Event, error)

func (Event) CancelRegistration

func (event Event) CancelRegistration(userId int64) error

func (Event) Delete

func (event Event) Delete() error

func (Event) Register

func (event Event) Register(userId int64) error

func (*Event) Save

func (e *Event) Save() error

func (Event) Update

func (event Event) Update() error

type User

type User struct {
	ID        int64  `json:"id"`
	Email     string `json:"email" binding:"required"`
	Password  string `json:"password" binding:"required"`
	Activated int64  `json:"activated"`
}

func (*User) Save

func (u *User) Save() error

func (*User) ValidateCredentials

func (u *User) ValidateCredentials() error

Jump to

Keyboard shortcuts

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