types

package
v1.14.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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 CHMap added in v1.14.1

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

CHMap 实现任意Map,用于clickhouse;与 Map 不一样的是,修改了 Value() 方法

func (*CHMap[T, Q]) Scan added in v1.14.1

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

Scan implements the Scanner interface.

func (*CHMap[T, Q]) Set added in v1.14.1

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

Set implements flag.Value::Set interface.

func (CHMap[T, Q]) String added in v1.14.1

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

String implements flag.Value::String interface.

func (CHMap[T, Q]) Value added in v1.14.1

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

Value implements the driver Valuer interface.

type CHSlice added in v1.14.1

type CHSlice[T any] []T

CHSlice 实现任意切片类型,用于clickhouse;与 Slice 不一样的是,修改了 Value() 方法

func (*CHSlice[T]) Scan added in v1.14.1

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

Scan implements the Scanner interface.

func (*CHSlice[T]) Set added in v1.14.1

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

Set implements flag.Value::Set interface.

func (CHSlice[T]) String added in v1.14.1

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

String implements flag.Value::String interface.

func (CHSlice[T]) Value added in v1.14.1

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

Value implements the driver Valuer interface.

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