Documentation ¶
Index ¶
- Variables
- func ErrorToRanderJson(err error) puzzle.DefaultRender
- type Api
- type BaseError
- type ConsumeHandler
- type Controller
- func (entity *Controller) Action()
- func (entity *Controller) BindParam(req interface{}) bool
- func (entity *Controller) BindParamError(req interface{}) error
- func (entity *Controller) RenderHttpError(errNo int, errDetail ...interface{})
- func (entity *Controller) RenderJsonAbort(err error)
- func (entity *Controller) RenderJsonFail(err error)
- func (entity *Controller) RenderJsonSucc(data interface{})
- type Dao
- func (entity *Dao) Create(value interface{}) error
- func (entity *Dao) GetDB(args ...string) *gorm.DB
- func (entity *Dao) GetModel() interface{}
- func (entity *Dao) GetTable() string
- func (entity *Dao) PreUse(args ...interface{})
- func (entity *Dao) Printf(msg string, args ...interface{})
- func (entity *Dao) SetDB(db *gorm.DB)
- func (entity *Dao) SetModel(model interface{})
- func (entity *Dao) SetTable(tableName string)
- func (entity *Dao) Update(model interface{}, attrs interface{}, query interface{}, args ...interface{}) error
- type DataSet
- type Flow
- func (entity *Flow) CountArgs() int
- func (entity *Flow) GetAllArgs() []interface{}
- func (entity *Flow) GetArgs(idx int) interface{}
- func (entity *Flow) GetContext() *gin.Context
- func (entity *Flow) GetLog() *zap.SugaredLogger
- func (entity *Flow) GetLogCtx() *puzzle.LogCtx
- func (entity *Flow) LogDebug(args ...interface{})
- func (entity *Flow) LogDebugf(format string, args ...interface{})
- func (entity *Flow) LogError(args ...interface{})
- func (entity *Flow) LogErrorf(format string, args ...interface{})
- func (entity *Flow) LogInfo(args ...interface{})
- func (entity *Flow) LogInfof(format string, args ...interface{})
- func (entity *Flow) LogWarn(args ...interface{})
- func (entity *Flow) LogWarnf(format string, args ...interface{})
- func (entity *Flow) PreUse(args ...interface{})
- func (entity *Flow) SetArgs(idx int, arg interface{}) *Flow
- func (entity *Flow) SetContext(ctx *gin.Context) *Flow
- func (entity *Flow) SetLog(log *zap.SugaredLogger) *Flow
- func (entity *Flow) SetLogCtx(logCtx *puzzle.LogCtx) *Flow
- func (entity *Flow) Use(newFlow IFlow, args ...interface{}) interface{}
- type IApi
- type IConsumer
- type IController
- type IDao
- type IDataSet
- type IFlow
- type INMQConsumer
- type IService
- type ITask
- type KFKConsumer
- func (entity *KFKConsumer) Cleanup(sarama.ConsumerGroupSession) error
- func (entity *KFKConsumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (entity *KFKConsumer) LogAndExit(format string, args ...interface{})
- func (entity *KFKConsumer) LoopKafka(handler ConsumeHandler)
- func (entity *KFKConsumer) Setup(sarama.ConsumerGroupSession) error
- type NmqConsumer
- type Service
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //StackLogger func(ctx *gin.Context, err error) ErrMsgMap map[int]string NmqResponseStatusCodeError = 500 NmqRetryError = 34002 )
Functions ¶
func ErrorToRanderJson ¶
func ErrorToRanderJson(err error) puzzle.DefaultRender
Types ¶
type ConsumeHandler ¶
type ConsumeHandler func(sarama.ConsumerGroupSession, *sarama.ConsumerMessage) error
type Controller ¶
type Controller struct {
Flow
}
func (*Controller) Action ¶
func (entity *Controller) Action()
func (*Controller) BindParam ¶
func (entity *Controller) BindParam(req interface{}) bool
func (*Controller) BindParamError ¶ added in v1.1.4
func (entity *Controller) BindParamError(req interface{}) error
func (*Controller) RenderHttpError ¶
func (entity *Controller) RenderHttpError(errNo int, errDetail ...interface{})
func (*Controller) RenderJsonAbort ¶
func (entity *Controller) RenderJsonAbort(err error)
func (*Controller) RenderJsonFail ¶
func (entity *Controller) RenderJsonFail(err error)
func (*Controller) RenderJsonSucc ¶
func (entity *Controller) RenderJsonSucc(data interface{})
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
func (*Flow) GetAllArgs ¶
func (entity *Flow) GetAllArgs() []interface{}
func (*Flow) GetContext ¶
func (*Flow) GetLog ¶
func (entity *Flow) GetLog() *zap.SugaredLogger
type IConsumer ¶
type IConsumer interface { IFlow Run(args []string) error Setup(sarama.ConsumerGroupSession) error Cleanup(sarama.ConsumerGroupSession) error ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error }
type IController ¶
type IFlow ¶
type IFlow interface { GetContext() *gin.Context SetContext(*gin.Context) *Flow GetArgs(idx int) interface{} SetArgs(idx int, arg interface{}) *Flow GetAllArgs() []interface{} Use(newFlow IFlow, args ...interface{}) interface{} PreUse(args ...interface{}) GetLogCtx() *puzzle.LogCtx SetLogCtx(logCtx *puzzle.LogCtx) *Flow GetLog() *zap.SugaredLogger SetLog(log *zap.SugaredLogger) *Flow }
type INMQConsumer ¶
type KFKConsumer ¶ added in v1.0.4
type KFKConsumer struct { Flow Ready chan bool Topics []string // contains filtered or unexported fields }
func (*KFKConsumer) Cleanup ¶ added in v1.0.4
func (entity *KFKConsumer) Cleanup(sarama.ConsumerGroupSession) error
func (*KFKConsumer) ConsumeClaim ¶ added in v1.0.4
func (entity *KFKConsumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
func (*KFKConsumer) LogAndExit ¶ added in v1.0.4
func (entity *KFKConsumer) LogAndExit(format string, args ...interface{})
func (*KFKConsumer) LoopKafka ¶ added in v1.0.4
func (entity *KFKConsumer) LoopKafka(handler ConsumeHandler)
func (*KFKConsumer) Setup ¶ added in v1.0.4
func (entity *KFKConsumer) Setup(sarama.ConsumerGroupSession) error
type NmqConsumer ¶
type NmqConsumer struct {
Flow
}
Click to show internal directories.
Click to hide internal directories.