repos

package
v0.0.0-...-bc5d933 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRepo

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

func NewEventRepo

func NewEventRepo(db *sqlx.DB) (*EventRepo, error)

NewQueryRepo creates a query repo

func (*EventRepo) Close

func (r *EventRepo) Close() error

Close closes DB connection held by this repo.

func (*EventRepo) Create

func (r *EventRepo) Create(event entities.Event) (entities.Event, error)

Create creates a new event

func (*EventRepo) Delete

func (r *EventRepo) Delete(id string) error

Delete removes an event by ID

func (*EventRepo) FindByOwnerId

func (r *EventRepo) FindByOwnerId(ownerId string) ([]entities.Event, error)

FindByOwnerId returns a list of events by owner ID

func (*EventRepo) GetByID

func (r *EventRepo) GetByID(id string) (entities.Event, error)

GetByID finds a single event by given ID

type QueryRepo

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

func NewQueryRepo

func NewQueryRepo(db *sqlx.DB) (*QueryRepo, error)

NewQueryRepo creates a query repo

func (*QueryRepo) Close

func (r *QueryRepo) Close() error

Close closes DB connection held by this repo.

func (*QueryRepo) Create

func (r *QueryRepo) Create(owner_id, content, description string, active bool) (entities.Query, error)

Create creates a new query

func (*QueryRepo) Delete

func (r *QueryRepo) Delete(id string) error

Delete removes a query by ID

func (*QueryRepo) FindByOwnerId

func (r *QueryRepo) FindByOwnerId(ownerId string) ([]entities.Query, error)

FindByOwnerId returns a list of queries by owner ID

func (*QueryRepo) GetByID

func (r *QueryRepo) GetByID(id string) (entities.Query, error)

GetByID finds a single query by given ID

func (*QueryRepo) Update

func (r *QueryRepo) Update(id, content, description string, active bool) error

Update updates an existing query

type UserRepo

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

func NewUserRepo

func NewUserRepo(db *sqlx.DB) (*UserRepo, error)

func (*UserRepo) Close

func (r *UserRepo) Close()

Close the db

func (*UserRepo) Find

func (r *UserRepo) Find(email string) (entities.User, error)

Find a user

func (*UserRepo) Get

func (r *UserRepo) Get(id string) (entities.User, error)

Get a user

Jump to

Keyboard shortcuts

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