Documentation ¶
Index ¶
- Variables
- func AccessLogWrap(log *logrus.Logger) transport.ServiceOption
- 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 context.Context, scopeInfo ScopeInfo, name apistructs.TemplateName, ...) *apistructs.Audit
- func NewPage() *pb.Page
- func NewPage2(PageSize int64, CurPage int64) *pb.Page
- func NewPage3(PageSize int64, CurPage int64, TotalNum int64) *pb.Page
- 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 AccessLogWrap ¶ added in v1.3.0
func AccessLogWrap(log *logrus.Logger) transport.ServiceOption
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 context.Context, scopeInfo ScopeInfo, name apistructs.TemplateName, errInfo error, 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
func (NewPageQuery) ToPbPage ¶ added in v1.3.0
func (query NewPageQuery) ToPbPage() *pb.NewPageResult
type PageQuery ¶
func GetPageQuery ¶ added in v1.3.0
func (PageQuery) Convert ¶
func (query PageQuery) Convert() NewPageQuery
func (PageQuery) ToPbPage ¶ added in v1.3.0
func (query PageQuery) ToPbPage() *pb.PageResult
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.