postgres

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatsRepository

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

func NewCatsRepository

func NewCatsRepository(db *poolwrapper.Pool) *CatsRepository

func (*CatsRepository) All

func (r *CatsRepository) All(ctx context.Context) ([]*models.Cat, error)

func (*CatsRepository) Create

func (r *CatsRepository) Create(ctx context.Context, params dto.CreateCatParams) (catID int, err error)

func (*CatsRepository) Delete

func (r *CatsRepository) Delete(ctx context.Context, catID int) (err error)

func (*CatsRepository) One

func (r *CatsRepository) One(ctx context.Context, catID int) (*models.Cat, error)

func (*CatsRepository) Update

func (r *CatsRepository) Update(ctx context.Context, params dto.UpdateCatParams) (err error)

func (*CatsRepository) WithinTransaction

func (r *CatsRepository) WithinTransaction(ctx context.Context, f func(ctx context.Context) error) error

type MissionsRepository

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

func NewMissionsRepository

func NewMissionsRepository(db *poolwrapper.Pool) *MissionsRepository

func (*MissionsRepository) All

func (*MissionsRepository) Create

func (r *MissionsRepository) Create(ctx context.Context) (missionID int, err error)

func (*MissionsRepository) Delete

func (r *MissionsRepository) Delete(ctx context.Context, missionID int) (err error)

func (*MissionsRepository) One

func (r *MissionsRepository) One(ctx context.Context, missionID int) (*models.Mission, error)

func (*MissionsRepository) Update

func (r *MissionsRepository) Update(ctx context.Context, params dto.UpdateMissionParams) (err error)

type NotesRepository

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

func NewNotesRepository

func NewNotesRepository(db *poolwrapper.Pool) *NotesRepository

func (*NotesRepository) All

func (r *NotesRepository) All(ctx context.Context, missionID, targetID int) ([]*models.Note, error)

func (*NotesRepository) Create

func (r *NotesRepository) Create(ctx context.Context, missionID, targetID int, contents []string) error

type TargetsRepository

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

func NewTargetsRepository

func NewTargetsRepository(db *poolwrapper.Pool) *TargetsRepository

func (*TargetsRepository) All

func (r *TargetsRepository) All(ctx context.Context, missionID int) ([]*models.Target, error)

func (*TargetsRepository) Create

func (r *TargetsRepository) Create(ctx context.Context, missionID int, lastTargetID int, targets []dto.CreateTargetParams) error

func (*TargetsRepository) Delete

func (r *TargetsRepository) Delete(ctx context.Context, missionID, targetID int) (err error)

func (*TargetsRepository) One

func (r *TargetsRepository) One(ctx context.Context, missionID int, targetID int) (*models.Target, error)

func (*TargetsRepository) Update

func (r *TargetsRepository) Update(ctx context.Context, missionID, targetID int, completed *bool) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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