sample

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo implements the repos.SampleRepo interface against a postgres DB.

func New

func New(db *sqlx.DB, log log.Factory, cfg *viper.Viper) *Repo

New instance of the sample repository

func (*Repo) Create

func (r *Repo) Create(parentCtx context.Context, item repos.Item) (string, error)

func (*Repo) DB

func (r *Repo) DB() *sqlx.DB

func (*Repo) Delete

func (r *Repo) Delete(parentCtx context.Context, id string) error

func (*Repo) Get

func (r *Repo) Get(parentCtx context.Context, id string, _ ...repos.ItemOption) (repos.Item, error)

func (*Repo) List

func (r *Repo) List(ctx context.Context, _ ...repos.ItemOption) (repos.ItemsIterator, error)

func (*Repo) Logger

func (r *Repo) Logger() log.Factory

Logger used by tracer

func (*Repo) Update

func (r *Repo) Update(parentCtx context.Context, item repos.Item) error

Jump to

Keyboard shortcuts

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