postgres

package
v0.0.0-...-ea7ac5c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPicture = errors.New("no picture")

Functions

This section is empty.

Types

type PictureRepository

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

PictureRepository contains all methods for managing pictures in a database.

func NewPictureRepository

func NewPictureRepository(postgres *storage.Postgres) *PictureRepository

NewPictureRepository is a constructor for PictureRepository.

func (PictureRepository) Create

func (r PictureRepository) Create(ctx context.Context, picture model.Picture) error

Create inserts provided picture to the pictures table.

func (PictureRepository) GetByDate

func (r PictureRepository) GetByDate(ctx context.Context, dateTime time.Time) (model.Picture, error)

GetByDate selects picture from the pictures table by provided date.

func (PictureRepository) List

List selects all pictures from the pictures table.

Jump to

Keyboard shortcuts

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