Documentation ¶
Index ¶
- func AddCtrl(ctrl Controller)
- func DB(name ...string) *gorm.DB
- func DELETE(path string, handlers ...HandlerFunc)
- func GET(path string, handlers ...HandlerFunc)
- func KeyVal(name ...string) keyval.KeyValClient
- func Logger() *zap.Logger
- func NewJWT(data map[string]interface{}, ttl ...time.Duration) (string, error)
- func PATCH(path string, handlers ...HandlerFunc)
- func POST(path string, handlers ...HandlerFunc)
- func PUT(path string, handlers ...HandlerFunc)
- func PubSub(name ...string) pubsub.PubSubClient
- func Queue(name ...string) queue.QueueClient
- func RegAppCreator(name string, creator HttpAppCreatorFunc)
- func RegDBCreator(typeName string, creator DBCreatorFunc)
- func ReleaseLock(lock *DistLock) error
- func Start()
- func ValidateJWT(token string) (map[string]interface{}, error)
- type App
- type BaseRepo
- func (o *BaseRepo) AutoMigrate(value interface{}) error
- func (o *BaseRepo) Create(value interface{}) *gorm.DB
- func (o *BaseRepo) Delete(value interface{}) *gorm.DB
- func (o *BaseRepo) Exec(sql string, args ...interface{}) *gorm.DB
- func (o *BaseRepo) Find(dest interface{}, conds ...interface{}) *gorm.DB
- func (o *BaseRepo) First(dest interface{}, conds ...interface{}) *gorm.DB
- func (o *BaseRepo) Model(value interface{}) *gorm.DB
- func (o *BaseRepo) Raw(sql string, args ...interface{}) *gorm.DB
- func (o *BaseRepo) Table(name string) *gorm.DB
- func (o *BaseRepo) Update(value interface{}) *gorm.DB
- func (o *BaseRepo) Where(query interface{}, args ...interface{}) *gorm.DB
- type CodedError
- type Context
- type Controller
- type DBCreatorFunc
- type DistLock
- type FiberApp
- func (o *FiberApp) Delete(path string, handlers ...HandlerFunc)
- func (o *FiberApp) Get(path string, handlers ...HandlerFunc)
- func (o *FiberApp) Patch(path string, handlers ...HandlerFunc)
- func (o *FiberApp) Post(path string, handlers ...HandlerFunc)
- func (o *FiberApp) Put(path string, handlers ...HandlerFunc)
- func (o *FiberApp) Start()
- type FiberContext
- func (o *FiberContext) Bind(target interface{}) error
- func (o *FiberContext) Body() []byte
- func (o *FiberContext) FormFile(key string) (*multipart.FileHeader, error)
- func (o *FiberContext) FormValue(key string, defaultVal ...string) string
- func (o *FiberContext) Get(key string) string
- func (o *FiberContext) GetHeader(key string) string
- func (o *FiberContext) InvokeNativeCtx(handlerFunc interface{}) error
- func (o *FiberContext) Next() error
- func (o *FiberContext) Param(key string, defaultVal ...string) string
- func (o *FiberContext) Query(key string, defaultVal ...string) string
- func (o *FiberContext) SaveFile(key, path string) error
- func (o *FiberContext) SendError(err *CodedError) error
- func (o *FiberContext) SendFile(filePath string, fileName string) error
- func (o *FiberContext) SendFileBytes(data []byte, fileName string) error
- func (o *FiberContext) SendJSON(data interface{}) error
- func (o *FiberContext) SendPaged(data interface{}, currPage, totalPage int) error
- func (o *FiberContext) SendResult(data interface{}) error
- func (o *FiberContext) SendString(data string) error
- func (o *FiberContext) Set(key string, value string)
- func (o *FiberContext) SetHeader(key, value string)
- func (o *FiberContext) Status(code int) Context
- type HandlerFunc
- type HttpAppCreatorFunc
- type Result
- type ResultPaged
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCtrl ¶
func AddCtrl(ctrl Controller)
func DELETE ¶
func DELETE(path string, handlers ...HandlerFunc)
func GET ¶
func GET(path string, handlers ...HandlerFunc)
func KeyVal ¶
func KeyVal(name ...string) keyval.KeyValClient
func PATCH ¶
func PATCH(path string, handlers ...HandlerFunc)
func POST ¶
func POST(path string, handlers ...HandlerFunc)
func PUT ¶
func PUT(path string, handlers ...HandlerFunc)
func PubSub ¶
func PubSub(name ...string) pubsub.PubSubClient
func Queue ¶
func Queue(name ...string) queue.QueueClient
func RegAppCreator ¶
func RegAppCreator(name string, creator HttpAppCreatorFunc)
func RegDBCreator ¶
func RegDBCreator(typeName string, creator DBCreatorFunc)
func ReleaseLock ¶
func ValidateJWT ¶
Types ¶
type App ¶
type App interface { Get(path string, handlers ...HandlerFunc) Post(path string, handlers ...HandlerFunc) Put(path string, handlers ...HandlerFunc) Patch(path string, handlers ...HandlerFunc) Delete(path string, handlers ...HandlerFunc) Start() }
type CodedError ¶
func NewError ¶
func NewError(code int, msg string) *CodedError
func (*CodedError) Error ¶
func (o *CodedError) Error() string
type Context ¶
type Context interface { Status(code int) Context Body() []byte Param(key string, defaulVal ...string) string Query(key string, defaulVal ...string) string FormValue(key string, defaulVal ...string) string FormFile(key string) (*multipart.FileHeader, error) SaveFile(key, path string) error Bind(target interface{}) error SetHeader(key string, value string) GetHeader(key string) string Set(key string, value string) Get(key string) string SendString(data string) error SendJSON(data interface{}) error SendPaged(data interface{}, currPage, totalPage int) error SendFile(filePath string, fileName string) error SendFileBytes(data []byte, fileName string) error SendResult(data interface{}) error SendError(err *CodedError) error Next() error InvokeNativeCtx(handlerFunc interface{}) error }
type Controller ¶
type Controller interface {
Init()
}
type FiberApp ¶
type FiberApp struct {
// contains filtered or unexported fields
}
func (*FiberApp) Delete ¶
func (o *FiberApp) Delete(path string, handlers ...HandlerFunc)
func (*FiberApp) Get ¶
func (o *FiberApp) Get(path string, handlers ...HandlerFunc)
func (*FiberApp) Patch ¶
func (o *FiberApp) Patch(path string, handlers ...HandlerFunc)
func (*FiberApp) Post ¶
func (o *FiberApp) Post(path string, handlers ...HandlerFunc)
func (*FiberApp) Put ¶
func (o *FiberApp) Put(path string, handlers ...HandlerFunc)
type FiberContext ¶
type FiberContext struct {
// contains filtered or unexported fields
}
func (*FiberContext) Bind ¶
func (o *FiberContext) Bind(target interface{}) error
func (*FiberContext) Body ¶
func (o *FiberContext) Body() []byte
func (*FiberContext) FormFile ¶ added in v0.1.40
func (o *FiberContext) FormFile(key string) (*multipart.FileHeader, error)
func (*FiberContext) FormValue ¶
func (o *FiberContext) FormValue(key string, defaultVal ...string) string
func (*FiberContext) Get ¶
func (o *FiberContext) Get(key string) string
func (*FiberContext) GetHeader ¶
func (o *FiberContext) GetHeader(key string) string
func (*FiberContext) InvokeNativeCtx ¶ added in v0.1.20
func (o *FiberContext) InvokeNativeCtx(handlerFunc interface{}) error
func (*FiberContext) Next ¶
func (o *FiberContext) Next() error
func (*FiberContext) SaveFile ¶ added in v0.1.40
func (o *FiberContext) SaveFile(key, path string) error
func (*FiberContext) SendError ¶
func (o *FiberContext) SendError(err *CodedError) error
func (*FiberContext) SendFile ¶
func (o *FiberContext) SendFile(filePath string, fileName string) error
func (*FiberContext) SendFileBytes ¶
func (o *FiberContext) SendFileBytes(data []byte, fileName string) error
func (*FiberContext) SendJSON ¶
func (o *FiberContext) SendJSON(data interface{}) error
func (*FiberContext) SendPaged ¶
func (o *FiberContext) SendPaged(data interface{}, currPage, totalPage int) error
func (*FiberContext) SendResult ¶
func (o *FiberContext) SendResult(data interface{}) error
func (*FiberContext) SendString ¶
func (o *FiberContext) SendString(data string) error
func (*FiberContext) Set ¶
func (o *FiberContext) Set(key string, value string)
func (*FiberContext) SetHeader ¶
func (o *FiberContext) SetHeader(key, value string)
func (*FiberContext) Status ¶
func (o *FiberContext) Status(code int) Context
type HandlerFunc ¶
type HttpAppCreatorFunc ¶
type HttpAppCreatorFunc func() App
type ResultPaged ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.