types

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary added in v0.26.0

type Binary[T interface {
	encoding.BinaryMarshaler
}, Tp interface {
	*T
	encoding.BinaryUnmarshaler
}] struct {
	Val T
}

func (*Binary[T, Tp]) Scan added in v0.26.0

func (b *Binary[T, Tp]) Scan(value any) error

func (Binary[T, Tp]) Value added in v0.26.0

func (b Binary[T, Tp]) Value() (driver.Value, error)

type HStore added in v0.13.0

type HStore map[string]null.Val[string]

HStore is a wrapper for transferring HStore values back and forth easily.

func (*HStore) Scan added in v0.13.0

func (h *HStore) Scan(value any) error

Scan implements the Scanner interface.

Note h is reallocated before the scan to clear existing values. If the hstore column's database value is NULL, then h is set to nil instead.

func (HStore) Value added in v0.13.0

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

Value implements the driver Valuer interface. Note if h is nil, the database column value will be set to NULL.

type JSON

type JSON[T any] struct {
	Val T
}

func NewJSON added in v0.13.0

func NewJSON[T any](val T) JSON[T]

func (JSON[T]) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (JSON[T]) MarshalText

func (j JSON[T]) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*JSON[T]) Scan

func (j *JSON[T]) Scan(value any) error

Scan implements the Scanner interface.

func (*JSON[T]) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

func (*JSON[T]) UnmarshalText

func (j *JSON[T]) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (JSON[T]) Value

func (j JSON[T]) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Stringer added in v0.26.0

type Stringer[T interface {
	~[]byte | ~string
	fmt.Stringer
}] struct {
	Val T
}

func (*Stringer[T]) Scan added in v0.26.0

func (s *Stringer[T]) Scan(value any) error

func (Stringer[T]) Value added in v0.26.0

func (s Stringer[T]) Value() (driver.Value, error)

type Text added in v0.26.0

type Text[T interface {
	encoding.TextMarshaler
}, Tp interface {
	*T
	encoding.TextUnmarshaler
}] struct {
	Val T
}

func (*Text[T, Tp]) Scan added in v0.26.0

func (t *Text[T, Tp]) Scan(value any) error

func (Text[T, Tp]) Value added in v0.26.0

func (t Text[T, Tp]) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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