types

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 9 Imported by: 1

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 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 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)

type Time added in v0.35.0

type Time struct {
	time.Time
}

Time is a wrapper around time.Time for drivers that do not properly support time.Time

func (*Time) Scan added in v0.35.0

func (ut *Time) Scan(src any) error

func (Time) Value added in v0.35.0

func (ut Time) Value() (driver.Value, error)

type Uint64 added in v0.40.0

type Uint64 uint64

Uint64 is a custom type for uint64 that scans and saves to the database as a string.

func (*Uint64) Scan added in v0.40.0

func (u *Uint64) Scan(src any) error

Scan implements the sql.Scanner interface, converting a string from the database to Uint64.

func (Uint64) Value added in v0.40.0

func (u Uint64) Value() (driver.Value, error)

Value implements the driver.Valuer interface, converting the Uint64 to a string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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