types

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetValue

func MustGetValue[T any](m map[string]any, key string) (result T)

Types

type Map

type Map[T comparable, Q any] map[T]Q

Map 实现任意Map

func (*Map[T, Q]) Scan

func (m *Map[T, Q]) Scan(src any) error

Scan implements the Scanner interface.

func (Map[T, Q]) Value

func (m Map[T, Q]) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Slice

type Slice[T any] []T

Slice 实现任意切片类型

func (*Slice[T]) Scan

func (s *Slice[T]) Scan(src any) error

Scan implements the Scanner interface.

func (Slice[T]) Value

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

Value implements the driver Valuer interface.

type Time

type Time time.Time

Time 实现时间的序列化和反序列化,以及数据库驱动接口

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface

func (*Time) Scan

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

Scan implements the Scanner interface.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface

func (Time) Value

func (t Time) 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