Documentation
¶
Index ¶
- Variables
- func GetErrorCode(err error) string
- func MoneyToYuan(v uint64) float64
- type Converter
- type DefaultConverter
- func (c *DefaultConverter) Bool() bool
- func (c *DefaultConverter) Err() error
- func (c *DefaultConverter) Float32() float32
- func (c *DefaultConverter) Float64() float64
- func (c *DefaultConverter) Int() int
- func (c *DefaultConverter) Int16() int16
- func (c *DefaultConverter) Int64() int64
- func (c *DefaultConverter) Money() float64
- func (c *DefaultConverter) String() string
- func (c *DefaultConverter) TryBool() (bool, error)
- func (c *DefaultConverter) TryFloat32() (float32, error)
- func (c *DefaultConverter) TryFloat64() (float64, error)
- func (c *DefaultConverter) TryInt() (int, error)
- func (c *DefaultConverter) TryInt16() (int16, error)
- func (c *DefaultConverter) TryInt64() (int64, error)
- func (c *DefaultConverter) TryString() (string, error)
- func (c *DefaultConverter) TryUint() (uint, error)
- func (c *DefaultConverter) TryUint16() (uint16, error)
- func (c *DefaultConverter) TryUint64() (uint64, error)
- func (c *DefaultConverter) Uint() uint
- func (c *DefaultConverter) Uint16() uint16
- func (c *DefaultConverter) Uint64() uint64
- func (c *DefaultConverter) Value() interface{}
- type Error
- type Exception
Constants ¶
This section is empty.
Variables ¶
View Source
var ExceptionDebug = true
ExceptionDebug 表示全局默认是否是调试状态,默认:true
Functions ¶
func GetErrorCode ¶
func MoneyToYuan ¶
Types ¶
type Converter ¶
type Converter interface { Err() error Value() interface{} String() string TryString() (string, error) Bool() bool TryBool() (bool, error) Int16() int16 TryInt16() (int16, error) Int() int TryInt() (int, error) Int64() int64 TryInt64() (int64, error) Uint16() uint16 TryUint16() (uint16, error) Uint() uint TryUint() (uint, error) Uint64() uint64 TryUint64() (uint64, error) Float32() float32 TryFloat32() (float32, error) Float64() float64 TryFloat64() (float64, error) }
Converter 定义的一组转换函数,该接口用于指导其它依赖该转换的组件。 扩展 redis 或 sql 执行结果时刻返回该接口。
type DefaultConverter ¶
func (*DefaultConverter) Bool ¶
func (c *DefaultConverter) Bool() bool
func (*DefaultConverter) Err ¶
func (c *DefaultConverter) Err() error
func (*DefaultConverter) Float32 ¶
func (c *DefaultConverter) Float32() float32
func (*DefaultConverter) Float64 ¶
func (c *DefaultConverter) Float64() float64
func (*DefaultConverter) Int ¶
func (c *DefaultConverter) Int() int
func (*DefaultConverter) Int16 ¶
func (c *DefaultConverter) Int16() int16
func (*DefaultConverter) Int64 ¶
func (c *DefaultConverter) Int64() int64
func (*DefaultConverter) Money ¶
func (c *DefaultConverter) Money() float64
https://baike.baidu.com/item/%E5%9B%9B%E8%88%8D%E5%85%AD%E5%85%A5%E4%BA%94%E6%88%90%E5%8F%8C/9062547?fr=aladdin https://studygolang.com/articles/8390
func (*DefaultConverter) String ¶
func (c *DefaultConverter) String() string
func (*DefaultConverter) TryBool ¶
func (c *DefaultConverter) TryBool() (bool, error)
func (*DefaultConverter) TryFloat32 ¶
func (c *DefaultConverter) TryFloat32() (float32, error)
func (*DefaultConverter) TryFloat64 ¶
func (c *DefaultConverter) TryFloat64() (float64, error)
func (*DefaultConverter) TryInt ¶
func (c *DefaultConverter) TryInt() (int, error)
func (*DefaultConverter) TryInt16 ¶
func (c *DefaultConverter) TryInt16() (int16, error)
func (*DefaultConverter) TryInt64 ¶
func (c *DefaultConverter) TryInt64() (int64, error)
func (*DefaultConverter) TryString ¶
func (c *DefaultConverter) TryString() (string, error)
func (*DefaultConverter) TryUint ¶
func (c *DefaultConverter) TryUint() (uint, error)
func (*DefaultConverter) TryUint16 ¶
func (c *DefaultConverter) TryUint16() (uint16, error)
func (*DefaultConverter) TryUint64 ¶
func (c *DefaultConverter) TryUint64() (uint64, error)
func (*DefaultConverter) Uint ¶
func (c *DefaultConverter) Uint() uint
func (*DefaultConverter) Uint16 ¶
func (c *DefaultConverter) Uint16() uint16
func (*DefaultConverter) Uint64 ¶
func (c *DefaultConverter) Uint64() uint64
func (*DefaultConverter) Value ¶
func (c *DefaultConverter) Value() interface{}
type Exception ¶
type Exception struct {
// contains filtered or unexported fields
}
Exception 封装一个带有层级和 Code 的错误。
func (*Exception) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.