types

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 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]) Set added in v1.12.1

func (m *Map[T, Q]) Set(val string) error

Set implements flag.Value::Set interface.

func (Map[T, Q]) String added in v1.12.1

func (m Map[T, Q]) String() string

String implements flag.Value::String 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]) Set added in v1.12.1

func (t *Slice[T]) Set(val string) error

Set implements flag.Value::Set interface.

func (Slice[T]) String added in v1.12.1

func (t Slice[T]) String() string

String implements flag.Value::String 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) Set added in v1.12.1

func (t *Time) Set(val string) error

Set implements flag.Value::Set interface.

func (Time) String added in v1.12.1

func (t Time) String() string

String implements flag.Value::String 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