storage

package
v0.0.0-...-3c84259 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	// Prepare(ctx context.Context, name, sql string) (pgconn.StatementDescription, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Storage

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

func New

func New(db DBTX) *Storage

func (*Storage) Create

func (x *Storage) Create(ctx context.Context, u *us.User) (id uuid.UUID, err error)

func (*Storage) Delete

func (x *Storage) Delete(ctx context.Context, id uuid.UUID) error

func (*Storage) GetList

func (x *Storage) GetList(ctx context.Context, limit, offset int64, filter string) ([]us.User, error)

func (*Storage) Read

func (x *Storage) Read(ctx context.Context, id uuid.UUID) (*us.User, error)

func (*Storage) Update

func (x *Storage) Update(ctx context.Context, id uuid.UUID, u *us.User, fields ...string) error

type StorageTx

type StorageTx struct {
	*Storage
	// contains filtered or unexported fields
}

func NewTx

func NewTx(db *pgxpool.Pool) *StorageTx

func (*StorageTx) CreateTx

func (x *StorageTx) CreateTx(ctx context.Context, u *us.User) (id uuid.UUID, err error)

Jump to

Keyboard shortcuts

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