Documentation ¶
Index ¶
- Constants
- func AddDefaultService(service Service)
- func GetConfigWithFile(configFile string) (interface{}, error)
- func HandleFunc(app *App, s svc.Server) func(http.ResponseWriter, *http.Request)
- type App
- func (A *App) AddService(service Service)
- func (A *App) Each(cb func(name string, entry *Entry) bool)
- func (A *App) Errno() int
- func (A *App) GetConfig() interface{}
- func (A *App) GetDB(name string) (*sql.DB, string, error)
- func (A *App) GetEntry(name string) *Entry
- func (A *App) GetName() string
- func (A *App) GetRedis(name string) (*redis.Client, string, error)
- func (A *App) GetSharedObject(key string, fn func() (SharedObject, error)) (SharedObject, error)
- func (A *App) NewID() int64
- func (A *App) ParseConfig(name string, config interface{})
- func (A *App) Recycle()
- func (A *App) SendMessage(name string, data interface{}) error
- type Client
- type Context
- func (C *Context) GetApp() *App
- func (C *Context) GetCache(name string) (cache.ICache, error)
- func (C *Context) GetConfig() interface{}
- func (C *Context) GetDB(name string) (*sql.DB, string, error)
- func (C *Context) GetRedis(name string) (*redis.Client, string, error)
- func (C *Context) GetSharedObject(key string, fn func() (SharedObject, error)) (SharedObject, error)
- func (C *Context) GetTrace() string
- func (C *Context) NewID() int64
- func (C *Context) Printf(format string, v ...interface{})
- func (C *Context) Println(v ...interface{})
- func (C *Context) SendMessage(name string, data interface{}) error
- type Entry
- type Error
- type HTTPClient
- type IContext
- type Recycle
- type Service
- type SharedObject
- type Task
Constants ¶
View Source
const ERRNO_OK = 200
Variables ¶
This section is empty.
Functions ¶
func AddDefaultService ¶
func AddDefaultService(service Service)
func GetConfigWithFile ¶
func HandleFunc ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func NewAppWithConfig ¶
func NewAppWithConfigFile ¶
func NewAppWithEnv ¶
func (*App) AddService ¶
func (*App) GetSharedObject ¶
func (A *App) GetSharedObject(key string, fn func() (SharedObject, error)) (SharedObject, error)
func (*App) ParseConfig ¶
func (*App) SendMessage ¶
type Client ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) GetSharedObject ¶
func (C *Context) GetSharedObject(key string, fn func() (SharedObject, error)) (SharedObject, error)
func (*Context) SendMessage ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(baseURL string) *HTTPClient
func (*HTTPClient) Recycle ¶
func (C *HTTPClient) Recycle()
type IContext ¶
type IContext interface { GetTrace() string GetConfig() interface{} GetApp() *App GetDB(name string) (*sql.DB, string, error) GetRedis(name string) (*redis.Client, string, error) GetCache(name string) (cache.ICache, error) SendMessage(name string, data interface{}) error NewID() int64 Printf(fomrat string, v ...interface{}) Println(v ...interface{}) }
type SharedObject ¶
type SharedObject interface { }
Click to show internal directories.
Click to hide internal directories.