Documentation
¶
Index ¶
- Variables
- func AccessWrap(log *logrus.Logger) gin.HandlerFunc
- func AsyncRuntimeError(runtimeId, humanLog, primevalLog string)
- func InitLogger()
- func LogFileRotate(logger *logrus.Logger, logPath string, maxAge time.Duration, ...)
- func MakeAuditInfo(reqCtx *gin.Context, scopeInfo ScopeInfo, name apistructs.TemplateName, ...) *apistructs.Audit
- type ErrInfo
- type LineHook
- type NewPageQuery
- type Page
- func (page *Page) GetCurPage() int64
- func (page *Page) GetEndIndex() int64
- func (page *Page) GetPageSize() int64
- func (page *Page) GetStartIndex() int64
- func (page *Page) GetTotalNum() int64
- func (page *Page) GetTotalPageNum() int64
- func (page *Page) SetCurPage(num int64)
- func (page *Page) SetPageSize(size int64)
- func (page *Page) SetTotalNum(num int64)
- type PageQuery
- type ScopeInfo
- type StandardResult
- func (result *StandardResult) SetErrorInfo(errInfo *ErrInfo) *StandardResult
- func (result *StandardResult) SetReturnCode(returnCode StandaredReturnCode) *StandardResult
- func (result *StandardResult) SetSuccessAndData(data interface{}) *StandardResult
- func (result *StandardResult) SwitchLang(c *gin.Context) *StandardResult
- type StandaredReturnCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DEFAULT_PAGE_SIZE int64 = 15 DEFAULT_TOTAL_NUM int64 = 0 )
View Source
var AccessLog *logrus.Logger
View Source
var ErrorLog = logrus.StandardLogger()
Functions ¶
func AccessWrap ¶
func AccessWrap(log *logrus.Logger) gin.HandlerFunc
Logger is the logrus logger handler
func AsyncRuntimeError ¶
func AsyncRuntimeError(runtimeId, humanLog, primevalLog string)
func InitLogger ¶
func InitLogger()
func LogFileRotate ¶
func MakeAuditInfo ¶
func MakeAuditInfo(reqCtx *gin.Context, scopeInfo ScopeInfo, name apistructs.TemplateName, res *StandardResult, ctx map[string]interface{}) *apistructs.Audit
Types ¶
type LineHook ¶
type LineHook struct {
Field string
Skip int
Formatter func(file, function string, line int) string
// contains filtered or unexported fields
}
func NewLineHook ¶
type NewPageQuery ¶
type NewPageQuery struct {
List interface{} `json:"list"`
Total int64 `json:"total"`
}
func NewPages ¶
func NewPages(list interface{}, total int64) NewPageQuery
type Page ¶
type Page struct {
SerialVersionUID *int64 `json:"serialVersionUID"`
PageSize int64 `json:"pageSize"`
CurPage int64 `json:"curPage"`
TotalNum int64 `json:"totalNum"`
StartIndex int64 `json:"startIndex"`
EndIndex int64 `json:"endIndex"`
}
func (*Page) GetEndIndex ¶
func (*Page) GetStartIndex ¶
type PageQuery ¶
type PageQuery struct {
Result interface{} `json:"result"`
Page *Page `json:"page"`
}
func (PageQuery) Convert ¶
func (query PageQuery) Convert() NewPageQuery
type StandardResult ¶
type StandardResult struct {
Success bool `json:"success"`
Data interface{} `json:"data"`
Err *ErrInfo `json:"err"`
}
func NewStandardResult ¶
func NewStandardResult(succ ...bool) *StandardResult
func (*StandardResult) SetErrorInfo ¶
func (result *StandardResult) SetErrorInfo(errInfo *ErrInfo) *StandardResult
func (*StandardResult) SetReturnCode ¶
func (result *StandardResult) SetReturnCode(returnCode StandaredReturnCode) *StandardResult
func (*StandardResult) SetSuccessAndData ¶
func (result *StandardResult) SetSuccessAndData(data interface{}) *StandardResult
func (*StandardResult) SwitchLang ¶
func (result *StandardResult) SwitchLang(c *gin.Context) *StandardResult
type StandaredReturnCode ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.