types

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hstore

type Hstore map[string]interface{}

data type for storing sets of key/value pairs within a single PostgreSQL value.

func NewHstore

func NewHstore(text string) (Hstore, error)

build a hstore from string.

example:
text := `"ext"=>".jpg", "size"=>"34508", "width"=>"758", "height"=>"140", "quality"=>"93"`

func StructToHstore

func StructToHstore(s interface{}) Hstore

func (Hstore) Get

func (h Hstore) Get(k string) (v interface{})

func (*Hstore) Scan

func (h *Hstore) Scan(src interface{}) (err error)

driver.Scanner for sql value load

func (Hstore) Set

func (h Hstore) Set(k string, v interface{})

func (Hstore) Value

func (h Hstore) Value() (driver.Value, error)

driver.Valuer for sql value save

type Hstorer

type Hstorer interface {
	Hstore() Hstore
}

type JsonKV

type JsonKV map[string]interface{}

func (JsonKV) Filter

func (meta JsonKV) Filter(keys ...string) (out JsonKV)

func (JsonKV) Get

func (meta JsonKV) Get(key string) (v interface{}, ok bool)

func (JsonKV) IsEmpty

func (m JsonKV) IsEmpty() bool

func (*JsonKV) Merge

func (m *JsonKV) Merge(other JsonKV)

func (*JsonKV) Scan

func (m *JsonKV) Scan(b interface{}) error

func (JsonKV) Set

func (meta JsonKV) Set(k string, v interface{})

func (JsonKV) ToMaps

func (z JsonKV) ToMaps(h map[string][]string)

func (JsonKV) Unset

func (m JsonKV) Unset(k string)

func (JsonKV) Value

func (m JsonKV) Value() (driver.Value, error)

type NullHstore

type NullHstore struct {
	Hstore Hstore
	Valid  bool // Valid is true if Hstore is not NULL
}

func (*NullHstore) Scan

func (n *NullHstore) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullHstore) Value

func (n NullHstore) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Qarray

type Qarray []interface{}

func NewQarray

func NewQarray(a []string) (Qarray, error)

func NewQarrayText

func NewQarrayText(s string) (Qarray, error)

func (Qarray) Contains

func (q Qarray) Contains(s string) bool

Contains returns true if the string s is found

func (Qarray) Index

func (q Qarray) Index(s string) int

Index returns the index of the string s in Qarray, or -1 if s is not found.

func (*Qarray) Scan

func (q *Qarray) Scan(src interface{}) (err error)

driver.Scanner for sql value load

func (Qarray) ToStringSlice

func (q Qarray) ToStringSlice() []string

func (Qarray) Value

func (q Qarray) Value() (driver.Value, error)

driver.Valuer for sql value save

type StringArray

type StringArray = pq.StringArray

type StringSlice

type StringSlice pq.StringArray

func (StringSlice) Contains

func (q StringSlice) Contains(s string) bool

Contains returns true if the string s is found

func (StringSlice) Index

func (q StringSlice) Index(s string) int

Index returns the index of the string s in StringSlice, or -1 if s is not found.

Jump to

Keyboard shortcuts

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