dbkit

package
v0.8.16 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TxoKey is key for Txo
	TxoKey key = iota
)

Variables

This section is empty.

Functions

func CtxWithTxo

func CtxWithTxo(parent context.Context) context.Context

CtxWithTxo return context with txo

func ErrCtx

func ErrCtx(ctx context.Context) error

ErrCtx return error from context

func GetCache

func GetCache(client *redis.Client, key string, val interface{}) (err error)

GetCache to get cache

func SetCache

func SetCache(client *redis.Client, key string, val interface{}, exp time.Duration) error

SetCache to set cache

func SetErrCtx

func SetErrCtx(ctx context.Context, err error) error

SetErrCtx to set tx in ctx

func SetTxCtx

func SetTxCtx(ctx context.Context, tx sq.BaseRunner) error

SetTxCtx to set tx in ctx

func TxCtx

func TxCtx(ctx context.Context, t sq.BaseRunner) sq.BaseRunner

TxCtx return transaction from context if any or return t params

Types

type JSON

type JSON json.RawMessage

JSON type

func (*JSON) MarshalJSON

func (j *JSON) MarshalJSON() ([]byte, error)

MarshalJSON to marshal to json formatted

func (*JSON) Scan

func (j *JSON) Scan(src interface{}) error

Scan is implement of scanner

func (*JSON) UnmarshalJSON

func (j *JSON) UnmarshalJSON(data []byte) error

UnmarshalJSON to unmarshal

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

Value is implement of Valuer

type Txo

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

Txo stand of transaction object

Jump to

Keyboard shortcuts

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