Documentation ¶
Index ¶
- Variables
- func Base() string
- func Init()
- func PreInit()
- func Register(path, method string, h func(w http.ResponseWriter, r *http.Request))
- func RegisterFileSystem(fs http.FileSystem)
- func StartServer(port int)
- func StopServer()
- type Controller
- func (v *Controller) Assert(condition bool, message string)
- func (v *Controller) AssertNilErr(err error)
- func (v *Controller) GetFormInt(name string) (string, int64)
- func (v *Controller) GetFormString(name string) string
- func (v *Controller) GetQueryString(name string) string
- func (v *Controller) RedirectIf(condition bool, location string)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorHandleFunc func(http.ResponseWriter, *http.Request, string)
)
globals
Functions ¶
func Register ¶
func Register(path, method string, h func(w http.ResponseWriter, r *http.Request))
Register adds a handler to this router.
func RegisterFileSystem ¶
func RegisterFileSystem(fs http.FileSystem)
RegisterFileSystem is a custom version of Register where it adds a http.FileSystem to the router
func StartServer ¶
func StartServer(port int)
StartServer initializes this server and listens on port
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the htp package's extension
func GetController ¶
func GetController(r *http.Request) *Controller
GetController allows you to gain access to this method's htp.Controller
func (*Controller) Assert ¶
func (v *Controller) Assert(condition bool, message string)
Assert will exit this http method if condition is not met
func (*Controller) AssertNilErr ¶
func (v *Controller) AssertNilErr(err error)
func (*Controller) GetFormInt ¶
func (v *Controller) GetFormInt(name string) (string, int64)
func (*Controller) GetFormString ¶
func (v *Controller) GetFormString(name string) string
func (*Controller) GetQueryString ¶
func (v *Controller) GetQueryString(name string) string
func (*Controller) RedirectIf ¶
func (v *Controller) RedirectIf(condition bool, location string)
RedirectIf will redirct to location if condition is met
Click to show internal directories.
Click to hide internal directories.