repository

package
v0.0.0-...-26d71a5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventNotFound      = errors.New("event not found")
	ErrEventAlreadyExists = errors.New("event already exists")
)
View Source
var (
	ErrSpaceNotFound      = errors.New("space not found")
	ErrSpaceAlreadyExists = errors.New("space already exists")
)
View Source
var (
	ErrUserNotFound      = errors.New("user not found")
	ErrUserAlreadyExists = errors.New("user already exists")
)

Functions

This section is empty.

Types

type EventRepository

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

func NewEventRepository

func NewEventRepository(once *sync.Once, db *database.Postgres) *EventRepository

func (*EventRepository) AddUser

func (r *EventRepository) AddUser(ctx context.Context, eventId, userId int) error

TODO: Err already joined

func (*EventRepository) DeleteEvent

func (r *EventRepository) DeleteEvent(ctx context.Context, id int) error

func (*EventRepository) GetEvent

func (r *EventRepository) GetEvent(ctx context.Context, id int) (*entity.Event, error)

func (*EventRepository) InsertEvent

func (r *EventRepository) InsertEvent(ctx context.Context, userId int, event *entity.Event) error

type SpaceRepository

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

func NewSpaceRepository

func NewSpaceRepository(once *sync.Once, db *database.Postgres) *SpaceRepository

func (*SpaceRepository) AddUser

func (r *SpaceRepository) AddUser(ctx context.Context, userId, spaceId int) error

TODO: err ALready Exists

func (*SpaceRepository) DeleteSpace

func (r *SpaceRepository) DeleteSpace(ctx context.Context, id int) error

func (*SpaceRepository) GetSpace

func (r *SpaceRepository) GetSpace(ctx context.Context, id int) (*entity.Space, error)

func (*SpaceRepository) InsertSpace

func (r *SpaceRepository) InsertSpace(ctx context.Context, userId int, space *entity.Space) error

func (*SpaceRepository) UpdateSpace

func (r *SpaceRepository) UpdateSpace(ctx context.Context, id int, name, description string) error

type UserRepository

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

func NewUserRepository

func NewUserRepository(once *sync.Once, db *database.Postgres) *UserRepository

func (*UserRepository) DeleteUser

func (r *UserRepository) DeleteUser(ctx context.Context, userId, spaceId int) error

func (*UserRepository) GetForm

func (r *UserRepository) GetForm(ctx context.Context, userId, spaceId int) (*entity.Form, error)

func (*UserRepository) GetUserData

func (r *UserRepository) GetUserData(ctx context.Context, id int) (*entity.User, error)

func (*UserRepository) GetUserForms

func (r *UserRepository) GetUserForms(ctx context.Context, userId int) ([]*entity.Form, error)

func (*UserRepository) InsertUser

func (r *UserRepository) InsertUser(ctx context.Context, user *entity.User) error

func (*UserRepository) UpdateForm

func (r *UserRepository) UpdateForm(ctx context.Context, userId, spaceId int, userTags, pairTags entity.Tags) error

func (*UserRepository) UpdateUser

func (r *UserRepository) UpdateUser(ctx context.Context, id int, firstName, lastName, userName, photoURL string) (*entity.User, error)

Jump to

Keyboard shortcuts

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