storage

package
v0.0.0-...-9841d36 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONBValue

func JSONBValue(i interface{}) (driver.Value, error)

JSONBValue takes an interface and provides a driver.Value that can be stored as a JSONB column.

func ScanJSONB

func ScanJSONB(dst interface{}, src interface{}) error

ScanJSONB decodes a JSON byte stream into the passed dst value.

Types

type JSONB

type JSONB struct {
	V interface{}
}

JSONB represents a PostgreSQL's JSONB value: https://www.postgresql.org/docs/9.6/static/datatype-json.html. JSONB satisfies sqlbuilder.ScannerValuer.

func (JSONB) MarshalJSON

func (j JSONB) MarshalJSON() ([]byte, error)

MarshalJSON encodes the wrapper value as JSON.

func (*JSONB) Scan

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

Scan satisfies the sql.Scanner interface.

func (*JSONB) UnmarshalJSON

func (j *JSONB) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes the given JSON into the wrapped value.

func (JSONB) Value

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

Value satisfies the driver.Valuer interface.

type PSQL

type PSQL struct {
	DB     *db.DB
	Logger *log.Logger
}

Connection pool + logger

func NewPSQL

func NewPSQL(ctx context.Context, options map[string]interface{}, logger *log.Logger) (*PSQL, error)

Jump to

Keyboard shortcuts

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