storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Set(k string, p string, v interface{}, d time.Duration) *model.TechnicalError
	Hset(k string, p string, v interface{}) *model.TechnicalError
	Delete(k string, p string) *model.TechnicalError
	Get(k string, p string) (v string, e *model.TechnicalError)
	Hget(k string, p string) (v string, e *model.TechnicalError)
	Ttl(k string, p string) (t time.Duration, e *model.TechnicalError)
}

func NewClusterRedis

func NewClusterRedis(o *RedisOptions) Cacher

func NewRedis

func NewRedis(o *RedisOptions) Cacher

type PgOptions

type PgOptions struct {
	Host    string
	Port    string
	User    string
	Passwd  string
	Schema  string
	Options *string
	Logger  *zap.Logger
}

type PgPool

type PgPool struct {
	Pool *pgxpool.Pool
}

func NewPgPool

func NewPgPool(pg *PgOptions) *PgPool

type Pooler

type Pooler interface {
	BeginTx(ctx context.Context, opts pgx.TxOptions) (pgx.Tx, error)
	Begin(ctx context.Context) (pgx.Tx, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
}

type RedisOptions

type RedisOptions struct {
	Addr   string
	Addrs  []string
	Passwd string
	Index  int
	Pool   int
	Idle   int
	Logger *zap.Logger
}

Jump to

Keyboard shortcuts

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