Documentation ¶
Index ¶
- Constants
- func IsActionError(err ActionError) bool
- func TagContent(str string) (tagContent string, ok bool)
- type ActionError
- type ActionFunc
- type ErrorFunc
- type Executor
- type HttpRouter
- func (self *HttpRouter) GetAction(urlPath string) (Executor, error)
- func (self *HttpRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (self *HttpRouter) SetBasePath(basePath string) *HttpRouter
- func (self *HttpRouter) SetError(errorCode string, errorFunc ErrorFunc) *HttpRouter
- func (self *HttpRouter) SetRoute(pathPattern string, action ActionFunc) *HttpRouter
- type PathMatch
- type Transaction
- type TransactionInterface
- type TransactionWithDb
- type TransactionWithDbInterface
Constants ¶
View Source
const (
DefaultPattern = "[^/]+"
)
Variables ¶
This section is empty.
Functions ¶
func IsActionError ¶
func IsActionError(err ActionError) bool
Types ¶
type ActionError ¶
type ActionError struct {
// contains filtered or unexported fields
}
func NewActionError ¶
func NewActionError(code string, message string) ActionError
func (ActionError) Code ¶
func (e ActionError) Code() string
func (ActionError) Error ¶
func (e ActionError) Error() string
type ActionFunc ¶
type ActionFunc func(TransactionInterface) (string, ActionError)
type ActionFunc func(map[string]string, http.ResponseWriter, *http.Request) (string, ActionError)
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func (*Executor) Exec ¶
func (e *Executor) Exec(w http.ResponseWriter, r *http.Request) (string, ActionError)
type HttpRouter ¶
type HttpRouter struct {
// contains filtered or unexported fields
}
func NewHttpRouter ¶
func NewHttpRouter() *HttpRouter
func (*HttpRouter) ServeHTTP ¶
func (self *HttpRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HttpRouter) SetBasePath ¶
func (self *HttpRouter) SetBasePath(basePath string) *HttpRouter
func (*HttpRouter) SetError ¶
func (self *HttpRouter) SetError(errorCode string, errorFunc ErrorFunc) *HttpRouter
func (*HttpRouter) SetRoute ¶
func (self *HttpRouter) SetRoute(pathPattern string, action ActionFunc) *HttpRouter
type PathMatch ¶
type PathMatch struct {
// contains filtered or unexported fields
}
func NewPathMatch ¶
func NewPathMatch() *PathMatch
func (*PathMatch) GetRegexp ¶
<name:pattern> -> (?P<name>pattern) <name> -> (?P<name>defaultPattern) otherString -> regexp.QuoteMeta(otherString)
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
type TransactionInterface ¶
type TransactionWithDbInterface ¶
type TransactionWithDbInterface interface { TransactionInterface SetDb(*sql.DB) Db() *sql.DB }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.