storage

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 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 CRUD

type CRUD[T any, I any] struct {
	// contains filtered or unexported fields
}

func NewCrud

func NewCrud[T any, I any](scan func(row pgx.CollectableRow) (T, error), pool *pgxpool.Pool, sel, selIds, ins, upd, del string) *CRUD[T, I]

func (CRUD[T, I]) Add

func (c CRUD[T, I]) Add(attr ...any) I

func (CRUD[T, I]) Delete

func (c CRUD[T, I]) Delete(attr ...any) int64

func (CRUD[T, I]) GetById

func (c CRUD[T, I]) GetById(id I) (T, error)

func (CRUD[T, I]) GetByIds

func (c CRUD[T, I]) GetByIds(id []uint64) ([]T, error)

func (CRUD[T, I]) Update

func (c CRUD[T, I]) Update(attr ...any) int64

type Config

type Config interface {
	Get(string) string
}

type Storage

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

func New

func New(cfg Config) *Storage

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) Get

func (s *Storage) Get() *pgxpool.Pool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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