types

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONScan

func JSONScan(dst interface{}, value interface{}) error

JSONScan is a generic helper for storing a value as a JSON blob in SQL.

func JSONValue

func JSONValue(src interface{}) (driver.Value, error)

JSONValue is a generic helper for retrieving a SQL JSON-encoded value.

Types

type JSONRawMessage

type JSONRawMessage json.RawMessage

JSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger.

func (JSONRawMessage) MarshalJSON

func (m JSONRawMessage) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*JSONRawMessage) Scan

func (m *JSONRawMessage) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*JSONRawMessage) UnmarshalJSON

func (m *JSONRawMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (JSONRawMessage) Value

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

Value implements the driver Valuer interface.

type NullJSONRawMessage

type NullJSONRawMessage json.RawMessage

NullJSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger and is NULLable-

func (NullJSONRawMessage) MarshalJSON

func (m NullJSONRawMessage) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*NullJSONRawMessage) Scan

func (m *NullJSONRawMessage) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*NullJSONRawMessage) UnmarshalJSON

func (m *NullJSONRawMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (NullJSONRawMessage) Value

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

Value implements the driver Valuer interface.

type NullString

type NullString string

swagger:type string

func (NullString) MarshalJSON

func (ns NullString) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*NullString) Scan

func (ns *NullString) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullString) String

func (ns NullString) String() string

String implements the Stringer interface.

func (*NullString) UnmarshalJSON

func (ns *NullString) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (NullString) Value

func (ns NullString) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTime

type NullTime time.Time

NullTime implements sql.NullTime functionality.

func (NullTime) MarshalJSON

func (ns NullTime) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*NullTime) Scan

func (ns *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*NullTime) UnmarshalJSON

func (ns *NullTime) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (NullTime) Value

func (ns NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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