types

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 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 Meta added in v1.5.0

type Meta map[string]interface{}

Meta JSON KV for sql

func (Meta) Filter added in v1.5.0

func (m Meta) Filter(keys ...string) (out Meta)

Filter ...

func (Meta) Get added in v1.5.0

func (m Meta) Get(key string) (v interface{}, ok bool)

Get ...

func (Meta) IsEmpty added in v1.5.0

func (m Meta) IsEmpty() bool

IsEmpty ...

func (*Meta) Merge added in v1.5.0

func (m *Meta) Merge(other Meta)

Merge ...

func (*Meta) Scan added in v1.5.0

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

Scan ...

func (Meta) Set added in v1.5.0

func (m Meta) Set(k string, v interface{})

Set ...

func (Meta) ToMaps added in v1.5.0

func (m Meta) ToMaps(h map[string][]string)

ToMaps ...

func (Meta) Unset added in v1.5.0

func (m Meta) Unset(k string)

Unset ...

func (Meta) Value added in v1.5.0

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

Value ...

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