conv

package
v0.0.0-...-cd4d371 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RedisTimeFormat = "2006-01-02T15:04:05.9999999+07:00"

Variables

View Source
var ErrType = errors.New("the cache item can not convert to the spec type")

Functions

func Bool

func Bool(i interface{}) bool

func Bytes

func Bytes(i interface{}) []byte

func Float32

func Float32(i interface{}) float32

func Float64

func Float64(i interface{}) float64

func GetBool

func GetBool(i interface{}) (bool, error)

func GetBoolDefault

func GetBoolDefault(i interface{}, def bool) bool

func GetBytes

func GetBytes(i interface{}) ([]byte, error)

func GetBytesDefault

func GetBytesDefault(i interface{}, def []byte) []byte

func GetFloat32

func GetFloat32(i interface{}) (float32, error)

func GetFloat32Default

func GetFloat32Default(i interface{}, def float32) float32

func GetFloat64

func GetFloat64(i interface{}) (float64, error)

func GetFloat64Default

func GetFloat64Default(i interface{}, def float64) float64

func GetInt

func GetInt(i interface{}) (int, error)

func GetInt64

func GetInt64(i interface{}) (int64, error)

func GetInt64Default

func GetInt64Default(i interface{}, def int64) int64

func GetIntDefault

func GetIntDefault(i interface{}, def int) int

func GetJSON

func GetJSON(i interface{}, to interface{}) ([]byte, error)

func GetString

func GetString(i interface{}) (string, error)

func GetStringDefault

func GetStringDefault(i interface{}, def string) string

func GetTime

func GetTime(i interface{}) (time.Time, error)

func GetTimeDefault

func GetTimeDefault(i interface{}, def time.Time) time.Time

func Int

func Int(i interface{}) int

func Int64

func Int64(i interface{}) int64

func String

func String(i interface{}) string

func Time

func Time(i interface{}) time.Time

Types

type Get

type Get func(context.Context, string) (interface{}, error)

func (Get) Bool

func (getter Get) Bool(ctx context.Context, key string) bool

func (Get) Bytes

func (getter Get) Bytes(ctx context.Context, key string) []byte

func (Get) Float32

func (getter Get) Float32(ctx context.Context, key string) float32

func (Get) Float64

func (getter Get) Float64(ctx context.Context, key string) float64

func (Get) Get

func (getter Get) Get(ctx context.Context, key string) (interface{}, error)

func (Get) GetBool

func (getter Get) GetBool(ctx context.Context, key string) (bool, error)

func (Get) GetBoolDefault

func (getter Get) GetBoolDefault(ctx context.Context, key string, def bool) bool

func (Get) GetBytes

func (getter Get) GetBytes(ctx context.Context, key string) ([]byte, error)

func (Get) GetFloat32

func (getter Get) GetFloat32(ctx context.Context, key string) (float32, error)

func (Get) GetFloat32Default

func (getter Get) GetFloat32Default(ctx context.Context, key string, def float32) float32

func (Get) GetFloat64

func (getter Get) GetFloat64(ctx context.Context, key string) (float64, error)

func (Get) GetFloat64Default

func (getter Get) GetFloat64Default(ctx context.Context, key string, def float64) float64

func (Get) GetInt

func (getter Get) GetInt(ctx context.Context, key string) (int, error)

func (Get) GetInt64

func (getter Get) GetInt64(ctx context.Context, key string) (int64, error)

func (Get) GetInt64Default

func (getter Get) GetInt64Default(ctx context.Context, key string, def int64) int64

func (Get) GetIntDefault

func (getter Get) GetIntDefault(ctx context.Context, key string, def int) int

func (Get) GetJSON

func (getter Get) GetJSON(ctx context.Context, key string, to interface{}) ([]byte, error)

func (Get) GetString

func (getter Get) GetString(ctx context.Context, key string) (string, error)

func (Get) GetStringDefault

func (getter Get) GetStringDefault(ctx context.Context, key string, def string) string

func (Get) GetTime

func (getter Get) GetTime(ctx context.Context, key string) (time.Time, error)

func (Get) GetTimeDefault

func (getter Get) GetTimeDefault(ctx context.Context, key string, def time.Time) time.Time

func (Get) Int

func (getter Get) Int(ctx context.Context, key string) int

func (Get) Int64

func (getter Get) Int64(ctx context.Context, key string) int64

func (Get) String

func (getter Get) String(ctx context.Context, key string) string

func (Get) Time

func (getter Get) Time(ctx context.Context, key string) time.Time

Jump to

Keyboard shortcuts

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