Documentation ¶
Index ¶
- func AddCtrl(ctrl Controller)
- func DB(name ...string) *gorm.DB
- func DELETE(path string, handlers ...HandlerFunc)
- func FileSecret(dsn string, key string) (string, error)
- func GET(path string, handlers ...HandlerFunc)
- func GetSecret(name string) (string, error)
- 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 RegAppCreator(name string, creator HttpAppCreatorFunc)
- func RegDBCreator(typeName string, creator DBCreatorFunc)
- func RegKeyValCreator(typeName string, creator KeyValCreatorFunc)
- func RegPubSubCreator(typeName string, creator PubSubCreatorFunc)
- func RegQueueCreator(typeName string, creator QueueCreatorFunc)
- func RegSecretFunc(typeName string, secFunc SecretFunc)
- 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 DistObjClient
- type DistObjReqMsg
- type DistObjResMsg
- 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) FormValue(key string, defaultVal ...string) string
- func (o *FiberContext) Get(key string) string
- func (o *FiberContext) GetHeader(key string) string
- 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) 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 KeyValClient
- type KeyValCreatorFunc
- type NatsPubSubClient
- func (o *NatsPubSubClient) Publish(subject string, msg interface{}) error
- func (o *NatsPubSubClient) QueueSubscribe(subject string, queue string, eventHandler PubSubEventHandler)
- func (o *NatsPubSubClient) Request(subject string, msg interface{}, timeOut ...time.Duration) (string, error)
- func (o *NatsPubSubClient) RequestSubscribe(subject string, eventHandler PubSubReqEventHandler)
- func (o *NatsPubSubClient) Subscribe(subject string, eventHandler PubSubEventHandler)
- type PubSubClient
- type PubSubCreatorFunc
- type PubSubEventHandler
- type PubSubReqEventHandler
- type QueueClient
- type QueueConsumerFunc
- type QueueCreatorFunc
- type RedisKeyVal
- func (o *RedisKeyVal) AtIndex(key string, index int64) string
- func (o *RedisKeyVal) AtIndexInt(key string, index int64) int
- func (o *RedisKeyVal) Del(key string) error
- func (o *RedisKeyVal) Expire(key string, ttl time.Duration) error
- func (o *RedisKeyVal) Get(key string) string
- func (o *RedisKeyVal) GetInt(key string) int
- func (o *RedisKeyVal) HDel(key string, fields ...string) error
- func (o *RedisKeyVal) HGet(key, field string) string
- func (o *RedisKeyVal) HGetAll(key string) map[string]string
- func (o *RedisKeyVal) HSet(key string, values map[string]interface{}) error
- func (o *RedisKeyVal) LPop(key string) string
- func (o *RedisKeyVal) LPopInt(key string) int
- func (o *RedisKeyVal) LPush(key string, val interface{}) error
- func (o *RedisKeyVal) Len(key string) int64
- func (o *RedisKeyVal) RPop(key string) string
- func (o *RedisKeyVal) RPopInt(key string) int
- func (o *RedisKeyVal) RPush(key string, val interface{}) error
- func (o *RedisKeyVal) Range(key string, start int64, stop int64) []string
- func (o *RedisKeyVal) Set(key string, val interface{}, ttl ...time.Duration) error
- func (o *RedisKeyVal) SetNX(key string, val interface{}, ttl ...time.Duration) bool
- type RedisQueue
- type Result
- type ResultPaged
- type SecretFunc
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 PATCH ¶
func PATCH(path string, handlers ...HandlerFunc)
func POST ¶
func POST(path string, handlers ...HandlerFunc)
func PUT ¶
func PUT(path string, handlers ...HandlerFunc)
func RegAppCreator ¶
func RegAppCreator(name string, creator HttpAppCreatorFunc)
func RegDBCreator ¶
func RegDBCreator(typeName string, creator DBCreatorFunc)
func RegKeyValCreator ¶
func RegKeyValCreator(typeName string, creator KeyValCreatorFunc)
func RegPubSubCreator ¶
func RegPubSubCreator(typeName string, creator PubSubCreatorFunc)
func RegQueueCreator ¶
func RegQueueCreator(typeName string, creator QueueCreatorFunc)
func RegSecretFunc ¶
func RegSecretFunc(typeName string, secFunc SecretFunc)
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 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 }
type Controller ¶
type Controller interface {
Init()
}
type DistObjClient ¶ added in v0.1.11
type DistObjClient struct {
// contains filtered or unexported fields
}
func DistObj ¶ added in v0.1.11
func DistObj(name ...string) *DistObjClient
func (*DistObjClient) AddImpl ¶ added in v0.1.11
func (o *DistObjClient) AddImpl(className string, impl interface{}) error
type DistObjReqMsg ¶ added in v0.1.11
type DistObjReqMsg struct {
Params []interface{}
}
type DistObjResMsg ¶ added in v0.1.11
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) 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) Next ¶
func (o *FiberContext) Next() 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 KeyValClient ¶
type KeyValClient interface { Set(key string, val interface{}, ttl ...time.Duration) error SetNX(key string, val interface{}, ttl ...time.Duration) bool Get(key string) string GetInt(key string) int Del(key string) error LPush(key string, val interface{}) error LPop(key string) string LPopInt(key string) int RPush(key string, val interface{}) error RPop(key string) string RPopInt(key string) int Len(key string) int64 AtIndex(key string, index int64) string AtIndexInt(key string, index int64) int Range(key string, start int64, stop int64) []string HSet(key string, values map[string]interface{}) error HGet(key, field string) string HGetAll(key string) map[string]string HDel(key string, fields ...string) error Expire(key string, ttl time.Duration) error }
func KeyVal ¶
func KeyVal(name ...string) KeyValClient
type KeyValCreatorFunc ¶
type KeyValCreatorFunc func(url string) (KeyValClient, error)
type NatsPubSubClient ¶
type NatsPubSubClient struct {
// contains filtered or unexported fields
}
func (*NatsPubSubClient) Publish ¶
func (o *NatsPubSubClient) Publish(subject string, msg interface{}) error
func (*NatsPubSubClient) QueueSubscribe ¶
func (o *NatsPubSubClient) QueueSubscribe(subject string, queue string, eventHandler PubSubEventHandler)
func (*NatsPubSubClient) RequestSubscribe ¶ added in v0.1.11
func (o *NatsPubSubClient) RequestSubscribe(subject string, eventHandler PubSubReqEventHandler)
func (*NatsPubSubClient) Subscribe ¶
func (o *NatsPubSubClient) Subscribe(subject string, eventHandler PubSubEventHandler)
type PubSubClient ¶
type PubSubClient interface { Publish(subject string, msg interface{}) error Request(subject string, msg interface{}, timeOut ...time.Duration) (string, error) Subscribe(subject string, eventHandler PubSubEventHandler) RequestSubscribe(subject string, eventHandler PubSubReqEventHandler) QueueSubscribe(subject string, queue string, eventHandler PubSubEventHandler) }
func PubSub ¶
func PubSub(name ...string) PubSubClient
type PubSubCreatorFunc ¶
type PubSubCreatorFunc func(connString string) (PubSubClient, error)
type PubSubEventHandler ¶
type PubSubReqEventHandler ¶ added in v0.1.11
type QueueClient ¶
type QueueClient interface { Publish(name string, payload interface{}) error Consume(name string, consumer QueueConsumerFunc) error }
func Queue ¶
func Queue(name ...string) QueueClient
type QueueConsumerFunc ¶
type QueueConsumerFunc func(payload string)
type QueueCreatorFunc ¶
type QueueCreatorFunc func(url string) (QueueClient, error)
type RedisKeyVal ¶
type RedisKeyVal struct {
// contains filtered or unexported fields
}
func (*RedisKeyVal) AtIndexInt ¶
func (o *RedisKeyVal) AtIndexInt(key string, index int64) int
func (*RedisKeyVal) Del ¶
func (o *RedisKeyVal) Del(key string) error
func (*RedisKeyVal) Expire ¶ added in v0.1.8
func (o *RedisKeyVal) Expire(key string, ttl time.Duration) error
func (*RedisKeyVal) Get ¶
func (o *RedisKeyVal) Get(key string) string
func (*RedisKeyVal) GetInt ¶
func (o *RedisKeyVal) GetInt(key string) int
func (*RedisKeyVal) HDel ¶ added in v0.1.8
func (o *RedisKeyVal) HDel(key string, fields ...string) error
func (*RedisKeyVal) HGet ¶ added in v0.1.8
func (o *RedisKeyVal) HGet(key, field string) string
func (*RedisKeyVal) HGetAll ¶ added in v0.1.8
func (o *RedisKeyVal) HGetAll(key string) map[string]string
func (*RedisKeyVal) HSet ¶ added in v0.1.8
func (o *RedisKeyVal) HSet(key string, values map[string]interface{}) error
func (*RedisKeyVal) LPop ¶
func (o *RedisKeyVal) LPop(key string) string
func (*RedisKeyVal) LPopInt ¶
func (o *RedisKeyVal) LPopInt(key string) int
func (*RedisKeyVal) LPush ¶
func (o *RedisKeyVal) LPush(key string, val interface{}) error
func (*RedisKeyVal) Len ¶
func (o *RedisKeyVal) Len(key string) int64
func (*RedisKeyVal) RPop ¶
func (o *RedisKeyVal) RPop(key string) string
func (*RedisKeyVal) RPopInt ¶
func (o *RedisKeyVal) RPopInt(key string) int
func (*RedisKeyVal) RPush ¶
func (o *RedisKeyVal) RPush(key string, val interface{}) error
func (*RedisKeyVal) Range ¶
func (o *RedisKeyVal) Range(key string, start int64, stop int64) []string
type RedisQueue ¶
type RedisQueue struct {
// contains filtered or unexported fields
}
func (*RedisQueue) Consume ¶
func (o *RedisQueue) Consume(name string, consumer QueueConsumerFunc) error
func (*RedisQueue) Publish ¶
func (o *RedisQueue) Publish(name string, payload interface{}) error
type ResultPaged ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.