Documentation ¶
Index ¶
- func MustSetUp(respProvider RespProvider, options ...Option)
- func Pack(code string, data interface{}, msgArgs ...interface{}) interface{}
- func PackFully(code, msg string, data interface{}, msgArgs ...interface{}) interface{}
- func Seal(code string, data interface{}, msgArgs ...interface{}) (string, error)
- func SealFully(code, msg string, data interface{}, msgArgs ...interface{}) (string, error)
- func SetUp(respProvider RespProvider, options ...Option) (err error)
- type FileData
- type Option
- type RespProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustSetUp ¶
func MustSetUp(respProvider RespProvider, options ...Option)
func Pack ¶ added in v2.2.11
func Pack(code string, data interface{}, msgArgs ...interface{}) interface{}
Pack 封装成响应结构体实例.
PS: 需要先成功调用 MustSetUp || SetUp.
func PackFully ¶ added in v2.2.11
func PackFully(code, msg string, data interface{}, msgArgs ...interface{}) interface{}
PackFully
PS: 需要先成功调用 MustSetUp || SetUp.
func SetUp ¶
func SetUp(respProvider RespProvider, options ...Option) (err error)
Types ¶
type Option ¶
type Option func(opts *options)
func WithFileDataSlice ¶
func WithFilePathSlice ¶
type RespProvider ¶
type RespProvider func(code, msg string, data interface{}) interface{}
RespProvider
@return 建议是个加上json tag的结构体实例指针
Click to show internal directories.
Click to hide internal directories.