models

package
v0.0.0-...-85173b4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEvent

func DeleteEvent(id int64) error

func Unregister

func Unregister(userId int64, eventId int64) error

Types

type Event

type Event struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name" binding:"required"`
	Description string    `json:"description" binding:"required"`
	Location    string    `json:"location" binding:"required"`
	DateTime    time.Time `json:"dateTime" binding:"required"`
	UserId      int64     `json:"user_id"`
}

func GetAllEvents

func GetAllEvents() ([]Event, error)

func GetEventById

func GetEventById(id int64) (*Event, error)

func (*Event) Register

func (e *Event) Register(userId int64) error

func (*Event) Save

func (e *Event) Save() error

func (*Event) Update

func (e *Event) Update() error

type User

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

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