Documentation ¶
Index ¶
- Constants
- func APIBoxSessionGetKeyAction(c *Context) interface{}
- func Create(c *Context, bean interface{}, params *Params) interface{}
- func CreateEx(c *Context, bean interface{}, params *Params, querySettings map[string]string) interface{}
- func Delete(c *Context, bean interface{}, params *Params) interface{}
- func Detail(c *Context, bean interface{}, params *Params) interface{}
- func DetailJoin(c *Context, bean interface{}, params *Params, joinConds [][]string) interface{}
- func HasDriver(name string) bool
- func IsError(x interface{}) bool
- func List(c *Context, beans interface{}, params *Params, queryDefines map[string]string) interface{}
- func ListJoin(c *Context, beans interface{}, params *Params, querySettings map[string]string, ...) interface{}
- func Move(c *Context, bean interface{}, srcIndex, dstIndex uint32) interface{}
- func SessionCreate(c *Context, session *xorm.Session, bean interface{}, params *Params) interface{}
- func SessionCreateEx(c *Context, session *xorm.Session, bean interface{}, params *Params, ...) interface{}
- func SessionDelete(c *Context, session *xorm.Session, bean interface{}, params *Params) interface{}
- func SessionDetail(c *Context, session *xorm.Session, beans interface{}, params *Params) interface{}
- func SessionDetailJoin(c *Context, session *xorm.Session, bean interface{}, params *Params, ...) interface{}
- func SessionList(c *Context, session *xorm.Session, beans interface{}, params *Params, ...) interface{}
- func SessionListJoin(c *Context, session *xorm.Session, beans interface{}, params *Params, ...) interface{}
- func SessionMove(c *Context, session *xorm.Session, bean interface{}, srcIndex, dstIndex uint32) interface{}
- func SessionUpdate(c *Context, session *xorm.Session, bean interface{}, params *Params) interface{}
- func SessionUpdateEx(c *Context, session *xorm.Session, bean interface{}, params *Params, ...) interface{}
- func Update(c *Context, bean interface{}, params *Params) interface{}
- func UpdateEx(c *Context, bean interface{}, params *Params, querySettings map[string]string) interface{}
- func WriteData(w http.ResponseWriter, r *http.Request, data interface{}, apiAction string, ...)
- func WriteResponse(c *Context, data interface{})
- type ActionFunc
- type App
- func (app *App) AddListenEventHandler(h ListenEventHandler)
- func (app *App) Close() error
- func (app *App) GetLogger() *logging.Logger
- func (app *App) Hook(tag string, actionFunc ActionFunc) *App
- func (app *App) InitDb()
- func (app *App) InitError()
- func (app *App) LoadConfigWords()
- func (app *App) LoadFilterErrors()
- func (app *App) RegisterModel(model interface{})
- func (app *App) RegisterModels(models []interface{})
- func (app *App) Route(routes []*Route) http.HandlerFunc
- func (app *App) Run(routes []*Route) error
- func (app *App) SessionStore() (*session.CookieStore, error)
- func (app *App) SetRoutes(routes []*Route)
- func (app *App) Use(middlewares ...negroni.Handler)
- func (app *App) UseBefore(refMwName string, middleware negroni.Handler)
- func (app *App) UseNamed(mName string, middleware negroni.Handler)
- func (app *App) UseNamedBefore(refMwName string, mName string, middleware negroni.Handler)
- type Context
- func (c *Context) Clear()
- func (c *Context) CloseResponse()
- func (c *Context) Delete(key interface{})
- func (c *Context) Get(key interface{}) interface{}
- func (c *Context) GetAll() map[interface{}]interface{}
- func (c *Context) GetAllOk() (map[interface{}]interface{}, bool)
- func (c *Context) GetDB(key interface{}) *xorm.Engine
- func (c *Context) GetInt(key interface{}) int
- func (c *Context) GetInt32(key interface{}) int32
- func (c *Context) GetInt32Ok(key interface{}) (int32, bool)
- func (c *Context) GetInt64(key interface{}) int64
- func (c *Context) GetInt64Ok(key interface{}) (int64, bool)
- func (c *Context) GetIntOk(key interface{}) (int, bool)
- func (c *Context) GetOk(key interface{}) (interface{}, bool)
- func (c *Context) GetString(key interface{}) string
- func (c *Context) GetStringOk(key interface{}) (string, bool)
- func (c *Context) GetUint(key interface{}) uint
- func (c *Context) GetUint32(key interface{}) uint32
- func (c *Context) GetUint32Ok(key interface{}) (uint32, bool)
- func (c *Context) GetUint64(key interface{}) uint64
- func (c *Context) GetUint64Ok(key interface{}) (uint64, bool)
- func (c *Context) GetUintOk(key interface{}) (uint, bool)
- func (c *Context) NewParams() *Params
- func (c *Context) Request() *http.Request
- func (c *Context) Response() http.ResponseWriter
- func (c *Context) Session(sessionName string) (*Session, error)
- func (c *Context) Set(key, val interface{})
- func (c *Context) UpgradeWebsocket() (*websocket.Conn, error)
- type DbManager
- func (dbm *DbManager) AddMysql(dbAlias, protocol, address, user, passwd, dbName string, ...) error
- func (dbm *DbManager) AddSqlite3(dbAlias, sqliteDb string, persistent bool) error
- func (dbm *DbManager) GetMysql(dbAlias string) (*xorm.Engine, error)
- func (dbm *DbManager) GetSqlite3(dbAlias string) (*xorm.Engine, error)
- func (dbm *DbManager) RemoveMysql(dbAlias string)
- func (dbm *DbManager) RemoveSqlite3(dbAlias string)
- func (dbm *DbManager) SetMysql(dbAlias string, engine *xorm.Engine)
- func (dbm *DbManager) SetMysqlLogLevel(dbAlias string, level string)
- func (dbm *DbManager) SetMysqlShowSQL(dbAlias string, show bool)
- func (dbm *DbManager) SetSqlite3(dbAlias string, engine *xorm.Engine)
- func (dbm *DbManager) SetSqlite3LogLevel(dbAlias string, level string)
- func (dbm *DbManager) SetSqlite3ShowSQL(dbAlias string, show bool)
- type Error
- type ErrorDefine
- type ErrorManager
- func (em *ErrorManager) GetLang() string
- func (em *ErrorManager) New(errType ErrorType, fields ...string) *Error
- func (em *ErrorManager) NewGroupError(group string, errType ErrorType, fields ...string) *Error
- func (em *ErrorManager) RegisterError(errType ErrorType, define *ErrorDefine)
- func (em *ErrorManager) RegisterErrors(defines map[ErrorType]*ErrorDefine)
- func (em *ErrorManager) RegisterGroupError(group string, errType ErrorType, define *ErrorDefine)
- func (em *ErrorManager) RegisterGroupErrors(group string, defines map[ErrorType]*ErrorDefine)
- func (em *ErrorManager) RegisterGroupWords(group string, wordMap map[string]map[string]string)
- func (em *ErrorManager) RegisterWords(wordMap map[string]map[string]string)
- func (em *ErrorManager) SetLang(lang string)
- type ErrorResult
- type ErrorResultWithData
- type ErrorType
- type Input
- type ListenEventHandler
- type Logger
- type ModelDefine
- func (m *ModelDefine) FieldGetTag(field, tagName string) *ModelTag
- func (m *ModelDefine) FieldHasTag(field, tagName string) bool
- func (m *ModelDefine) FieldTags(field string) []*ModelTag
- func (m *ModelDefine) Fields() []string
- func (m *ModelDefine) MainFields() []string
- func (m *ModelDefine) RefFields() []string
- func (m *ModelDefine) TableName(engine *xorm.Engine) string
- func (m *ModelDefine) TagFields(tagName string) []string
- type ModelManager
- type ModelTag
- type MySQLDB
- type Output
- type ParamRule
- type Params
- func (p *Params) Add(paramName string, filters ...filter.Filter) *Params
- func (p *Params) AddOrderBy(defaultOrderBy string, defaultOrder string, allowOrderBys []string, ...) *Params
- func (p *Params) AddPagination() *Params
- func (p *Params) Del(paramNames ...string) *Params
- func (p *Params) Get(paramName string) interface{}
- func (p *Params) GetAll() map[string]interface{}
- func (p *Params) GetIP(paramName string) net.IP
- func (p *Params) GetIPArray(paramName string) []net.IP
- func (p *Params) GetInt(paramName string) int
- func (p *Params) GetInt32(paramName string) int32
- func (p *Params) GetInt32Array(paramName string) []int32
- func (p *Params) GetInt32Range(paramName string) *types.Int32Range
- func (p *Params) GetInt64(paramName string) int64
- func (p *Params) GetInt64Array(paramName string) []int64
- func (p *Params) GetInt64Range(paramName string) *types.Int64Range
- func (p *Params) GetIntArray(paramName string) []int
- func (p *Params) GetIntRange(paramName string) *types.IntRange
- func (p *Params) GetString(paramName string) string
- func (p *Params) GetStringArray(paramName string) []string
- func (p *Params) GetTime(paramName string) *time.Time
- func (p *Params) GetTimeArray(paramName string) []*time.Time
- func (p *Params) GetTimeRange(paramName string) *types.TimeRange
- func (p *Params) GetTimestamp(paramName string) uint32
- func (p *Params) GetTimestampRange(paramName string) *types.TimestampRange
- func (p *Params) GetUint(paramName string) uint
- func (p *Params) GetUint32(paramName string) uint32
- func (p *Params) GetUint32Array(paramName string) []uint32
- func (p *Params) GetUint32Range(paramName string) *types.Uint32Range
- func (p *Params) GetUint64(paramName string) uint64
- func (p *Params) GetUint64Array(paramName string) []uint64
- func (p *Params) GetUint64Range(paramName string) *types.Uint64Range
- func (p *Params) GetUintArray(paramName string) []uint
- func (p *Params) GetUintRange(paramName string) *types.UintRange
- func (p *Params) Has(paramName string) bool
- func (p *Params) Parse() *Error
- func (p *Params) Set(paramName string, paramValue interface{}) *Params
- func (p *Params) SetDefaultOrder(string) *Params
- func (p *Params) Validate(paramName string, filters ...filter.Filter) *Error
- type RequestIdMaker
- type Result
- type Route
- type Session
- type Sqlite3DB
- type SuccessResult
Constants ¶
const ( ErrorObjectNotExist = iota ErrorObjectDuplicated ErrorNoObjectUpdated ErrorNoObjectDeleted ErrorMissingParam ErrorInvalidParam ErrorQuotaExceed ErrorPermissionDenied ErrorOperationFailed ErrorInternalError )
application error
Variables ¶
This section is empty.
Functions ¶
func APIBoxSessionGetKeyAction ¶
func APIBoxSessionGetKeyAction(c *Context) interface{}
返回 Cookie 密钥对
func DetailJoin ¶
func SessionCreate ¶
func SessionCreateEx ¶
func SessionDelete ¶
func SessionDetail ¶
func SessionDetailJoin ¶
func SessionList ¶
func SessionListJoin ¶
func SessionMove ¶
func SessionUpdate ¶
func SessionUpdateEx ¶
func WriteResponse ¶
func WriteResponse(c *Context, data interface{})
WriteResponse format api result according to the format specified by request params.
Types ¶
type ActionFunc ¶
type ActionFunc func(c *Context) (data interface{})
type App ¶
type App struct { Name string Host string Addr string ServerName string Router *mux.Router Config *config.Config DB *DbManager Model *ModelManager Error *ErrorManager Logger *Logger Routes []*Route Hooks map[string][]ActionFunc UnderMaintenance bool Middlewares map[string]negroni.Handler HTTPServer *http.Server // contains filtered or unexported fields }
func NewAppFromFile ¶
NewAppFromFile create an application from config file.
func NewAppFromYaml ¶
NewAppFromYaml create an application from specified yaml config string.
func (*App) AddListenEventHandler ¶
func (app *App) AddListenEventHandler(h ListenEventHandler)
AddListenEventHandler add handler when listen return.
func (*App) Hook ¶
func (app *App) Hook(tag string, actionFunc ActionFunc) *App
Hook add set global hook action at specified tag.
func (*App) LoadConfigWords ¶
func (app *App) LoadConfigWords()
LoadConfigWords load words config section to app.
func (*App) LoadFilterErrors ¶
func (app *App) LoadFilterErrors()
LoadFilterErrors load filter errors to app.
func (*App) RegisterModel ¶
func (app *App) RegisterModel(model interface{})
RegisterModel register a model for app.
func (*App) RegisterModels ¶
func (app *App) RegisterModels(models []interface{})
RegisterModels register models for app.
func (*App) Route ¶
func (app *App) Route(routes []*Route) http.HandlerFunc
Route return a handler func using by http.HandleFunc.
func (*App) SessionStore ¶
func (app *App) SessionStore() (*session.CookieStore, error)
SessionStore return the session store of application.
func (*App) UseBefore ¶
UseBefore will insert a middleware before specified middleware, and run middleware around the request handler.
type Context ¶
type Context struct { App *App Input *Input Output *Output DB *DbManager Model *ModelManager Error *ErrorManager }
func NewContext ¶
func (*Context) Clear ¶
func (c *Context) Clear()
Clear removes all values stored for a given request. This is usually called by a handler wrapper to clean up request variables at the end of a request lifetime. See ClearHandler().
func (*Context) CloseResponse ¶
func (c *Context) CloseResponse()
CloseResponse ignore the action return value and will not response anymore when action return.
func (*Context) Delete ¶
func (c *Context) Delete(key interface{})
Delete removes a value stored for a given key in a given request.
func (*Context) Get ¶
func (c *Context) Get(key interface{}) interface{}
Get returns a value stored for a given key in a given request.
func (*Context) GetAll ¶
func (c *Context) GetAll() map[interface{}]interface{}
GetAll returns all stored values for the request as a map. Nil is returned for invalid requests.
func (*Context) GetAllOk ¶
GetAllOk returns all stored values for the request as a map and a boolean value that indicates if the request was registered.
func (*Context) GetDB ¶
GetDB returns a *xorm.Engine value stored for a given key in a given request.
func (*Context) GetInt32 ¶
GetInt32 returns a int32 value stored for a given key in a given request.
func (*Context) GetInt32Ok ¶
GetInt32 returns a int32 value stored and presence state like multi-value return of map access.
func (*Context) GetInt64 ¶
GetInt64 returns a int64 value stored for a given key in a given request.
func (*Context) GetInt64Ok ¶
GetInt64 returns a int64 value stored and presence state like multi-value return of map access.
func (*Context) GetIntOk ¶
GetInt returns a int value stored and presence state like multi-value return of map access.
func (*Context) GetOk ¶
GetOk returns stored value and presence state like multi-value return of map access.
func (*Context) GetString ¶
GetString returns a string value stored for a given key in a given request.
func (*Context) GetStringOk ¶
GetString returns a string value stored and presence state like multi-value return of map access.
func (*Context) GetUint32 ¶
GetUint32 returns a uint32 value stored for a given key in a given request.
func (*Context) GetUint32Ok ¶
GetUint32 returns a uint32 value stored and presence state like multi-value return of map access.
func (*Context) GetUint64 ¶
GetUint64 returns a uint64 value stored for a given key in a given request.
func (*Context) GetUint64Ok ¶
GetUint64 returns a uint64 value stored and presence state like multi-value return of map access.
func (*Context) GetUintOk ¶
GetUint returns a uint value stored and presence state like multi-value return of map access.
func (*Context) NewParams ¶
Clear removes all values stored for a given request. This is usually called by a handler wrapper to clean up request variables at the end of a request lifetime. See ClearHandler().
func (*Context) Response ¶
func (c *Context) Response() http.ResponseWriter
Response return current response writer.
type DbManager ¶
type DbManager struct {
// contains filtered or unexported fields
}
func NewDbManager ¶
func NewDbManager() *DbManager
NewDbManager create and return a db manager object.
func (*DbManager) AddMysql ¶
func (dbm *DbManager) AddMysql(dbAlias, protocol, address, user, passwd, dbName string, maxIdleConns, maxOpenConns int) error
AddMysql add a mysql database to db mananger object.
func (*DbManager) AddSqlite3 ¶
AddSqlite3 add a sqlite3 database to db mananger object.
func (*DbManager) GetSqlite3 ¶
GetSqlite3 return a sqlite3 db engine.
func (*DbManager) RemoveMysql ¶
RemoveMysql remove a mysql database from db mananger object.
func (*DbManager) RemoveSqlite3 ¶
RemoveSqlite remove a sqlite3 database from db mananger object.
func (*DbManager) SetMysqlLogLevel ¶
SetMysqlLogLevel set log level for the mysql xorm engine.
func (*DbManager) SetMysqlShowSQL ¶
SetMysqlShowSQL set whether to show sql for the mysql xorm engine.
func (*DbManager) SetSqlite3 ¶
SetSqlite3 return a sqlite3 db engine.
func (*DbManager) SetSqlite3LogLevel ¶
SetSqlite3LogLevel set log level for the sqlite3 xorm engine.
func (*DbManager) SetSqlite3ShowSQL ¶
SetSqlite3ShowSQL set whether to show sql for the sqlite3 xorm engine.
type ErrorDefine ¶
type ErrorDefine struct {
// contains filtered or unexported fields
}
func NewErrorDefine ¶
func NewErrorDefine(code string, fieldCounts []int, msgTmpls map[string]map[int]string) *ErrorDefine
NewErrorDefine return an error define.
type ErrorManager ¶
type ErrorManager struct {
// contains filtered or unexported fields
}
func NewErrorManager ¶
func NewErrorManager() *ErrorManager
NewErrorManager return an error manager.
func (*ErrorManager) GetLang ¶
func (em *ErrorManager) GetLang() string
GetLang return the default language of ErrorManager.
func (*ErrorManager) New ¶
func (em *ErrorManager) New(errType ErrorType, fields ...string) *Error
New return an new error with specified error type. If error type need more fields, fields should be specified and will fill to error code. The message output in response will be automatically generated according to error code.
func (*ErrorManager) NewGroupError ¶
func (em *ErrorManager) NewGroupError(group string, errType ErrorType, fields ...string) *Error
NewGroupError return an new error with specified error type of specified group.
func (*ErrorManager) RegisterError ¶
func (em *ErrorManager) RegisterError(errType ErrorType, define *ErrorDefine)
RegisterError register a new error define in default group.
func (*ErrorManager) RegisterErrors ¶
func (em *ErrorManager) RegisterErrors(defines map[ErrorType]*ErrorDefine)
RegisterErrors register new error defines in default group.
func (*ErrorManager) RegisterGroupError ¶
func (em *ErrorManager) RegisterGroupError(group string, errType ErrorType, define *ErrorDefine)
RegisterGroupError register a new error define in specified group.
func (*ErrorManager) RegisterGroupErrors ¶
func (em *ErrorManager) RegisterGroupErrors(group string, defines map[ErrorType]*ErrorDefine)
RegisterGroupErrors register new error defines in specified group.
func (*ErrorManager) RegisterGroupWords ¶
func (em *ErrorManager) RegisterGroupWords(group string, wordMap map[string]map[string]string)
RegisterGroupWords register new word map in specified group.
func (*ErrorManager) RegisterWords ¶
func (em *ErrorManager) RegisterWords(wordMap map[string]map[string]string)
RegisterWords register new word map in default group.
func (*ErrorManager) SetLang ¶
func (em *ErrorManager) SetLang(lang string)
SetLang set the default language when generate message.
type ErrorResult ¶
type ErrorResultWithData ¶
type Input ¶
func (*Input) GetDefault ¶
获取请求值,如果请求值为空,则返回default值
type Logger ¶
type Logger struct { // Logger inherits from log.Logger used to log messages with the Logger middleware *logging.Logger *utils.Matcher }
Logger is a middleware handler that logs the request as it goes in and the response as it goes out.
func (*Logger) ServeHTTP ¶
func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type ModelDefine ¶
type ModelDefine struct { Type reflect.Type MainModelName string // contains filtered or unexported fields }
func (*ModelDefine) FieldGetTag ¶
func (m *ModelDefine) FieldGetTag(field, tagName string) *ModelTag
FieldGetTag get specified tag of field.
func (*ModelDefine) FieldHasTag ¶
func (m *ModelDefine) FieldHasTag(field, tagName string) bool
FieldHasTag check if field has specified tag.
func (*ModelDefine) FieldTags ¶
func (m *ModelDefine) FieldTags(field string) []*ModelTag
FieldTags return tags of specified field.
func (*ModelDefine) Fields ¶
func (m *ModelDefine) Fields() []string
Fields return all fields of model.
func (*ModelDefine) MainFields ¶
func (m *ModelDefine) MainFields() []string
Fields return fields of main table of model.
func (*ModelDefine) RefFields ¶
func (m *ModelDefine) RefFields() []string
Fields return fields of reference table of model.
func (*ModelDefine) TableName ¶
func (m *ModelDefine) TableName(engine *xorm.Engine) string
TableName return table name of model.
func (*ModelDefine) TagFields ¶
func (m *ModelDefine) TagFields(tagName string) []string
TagFields return fields with specified tag name.
type ModelManager ¶
type ModelManager struct {
Models map[string]*ModelDefine
}
func NewModelManager ¶
func NewModelManager() *ModelManager
func (*ModelManager) Get ¶
func (mm *ModelManager) Get(modelName string) *ModelDefine
Get return specified model.
func (*ModelManager) Has ¶
func (mm *ModelManager) Has(modelName string) bool
Has check if specified model is registered.
func (*ModelManager) Register ¶
func (mm *ModelManager) Register(model interface{})
Register add new model to this manager.
func (*ModelManager) Unregister ¶
func (mm *ModelManager) Unregister(modelName string)
Unregister remove existing model from this manager.
type Output ¶
type Output struct {
ResponseWriter http.ResponseWriter
}
type Params ¶
type Params struct { Rules []*ParamRule RawValues url.Values ParsedValues map[string]interface{} Error *ErrorManager }
func NewParams ¶
func NewParams(values url.Values, em *ErrorManager) *Params
NewParams return a new Params object.
func (*Params) AddOrderBy ¶
func (p *Params) AddOrderBy(defaultOrderBy string, defaultOrder string, allowOrderBys []string, allowMultiOrder bool) *Params
SetDefaultOrder set default order of pagination.
func (*Params) AddPagination ¶
AddPagination add a pagination params with filter functions.
func (*Params) GetIPArray ¶
GetIPArray return the parsed value of param as net.IP array.
func (*Params) GetInt32Array ¶
GetInt32Array return the parsed value of param as int32 array.
func (*Params) GetInt32Range ¶
func (p *Params) GetInt32Range(paramName string) *types.Int32Range
GetInt32Range return the parsed value of param as Int32Range.
func (*Params) GetInt64Array ¶
GetInt64Array return the parsed value of param as int64 array.
func (*Params) GetInt64Range ¶
func (p *Params) GetInt64Range(paramName string) *types.Int64Range
GetInt64Range return the parsed value of param as Int64Range.
func (*Params) GetIntArray ¶
GetIntArray return the parsed value of param as int array.
func (*Params) GetIntRange ¶
GetIntRange return the parsed value of param as IntRange.
func (*Params) GetStringArray ¶
GetStringArray return the parsed value of param as string array.
func (*Params) GetTimeArray ¶
GetTimeArray return the parsed value of param as time array.
func (*Params) GetTimeRange ¶
GetTimeRange return the parsed value of param as TimeRange.
func (*Params) GetTimestamp ¶
GetTimestamp return the parsed value of param as Timestamp.
func (*Params) GetTimestampRange ¶
func (p *Params) GetTimestampRange(paramName string) *types.TimestampRange
GetTimeRange return the parsed value of param as TimestampRange.
func (*Params) GetUint32Array ¶
GetUint32Array return the parsed value of param as uint32 array.
func (*Params) GetUint32Range ¶
func (p *Params) GetUint32Range(paramName string) *types.Uint32Range
GetUint32Range return the parsed value of param as Uint32Range.
func (*Params) GetUint64Array ¶
GetUint64Array return the parsed value of param as uint64 array.
func (*Params) GetUint64Range ¶
func (p *Params) GetUint64Range(paramName string) *types.Uint64Range
GetUint64Range return the parsed value of param as Uint64Range.
func (*Params) GetUintArray ¶
GetUintArray return the parsed value of param as uint array.
func (*Params) GetUintRange ¶
GetUintRange return the parsed value of param as UintRange.
func (*Params) SetDefaultOrder ¶
SetDefaultOrder set default order of pagination.
type RequestIdMaker ¶
type RequestIdMaker struct {
// contains filtered or unexported fields
}
RequestIdMaker is a middleware handler that auto generate the request id and append to response header.
func NewRequestIdMaker ¶
func NewRequestIdMaker() *RequestIdMaker
NewRequestIdMaker returns a new RequestIdMaker instance
func (*RequestIdMaker) ServeHTTP ¶
func (m *RequestIdMaker) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type Route ¶
type Route struct { ActionCode string ActionFunc ActionFunc Hooks map[string][]ActionFunc }
func NewRoute ¶
func NewRoute(actionCode string, actionFunc ActionFunc) *Route
NewRoute return a new route.