Documentation ¶
Index ¶
- Variables
- func ListenAndServe()
- func Middleware(m MiddlewareInterface)
- func Mixin(m MixinInterface)
- func NewTestClient(t *testing.T) *testClient
- func Pattern(pat string, h HandlerInterface)
- func SendMail(subject, message, to_address string) error
- func SendMailFrom(subject, message, to_address, from_address string) error
- func SendMassMail(subject, message string, to_addresses []string) error
- func SendMassMailFrom(subject, message, from_address string, to_addresses []string) error
- func SetNotFoundHandler(h HandlerInterface)
- func VersionMap() [3]int
- type BaseHandler
- func (h *BaseHandler) Delete(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) ErrorHandler(errorStr string) *HttpResponse
- func (h *BaseHandler) Finish(request *HttpRequest, response *HttpResponse)
- func (h *BaseHandler) Get(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) Head(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) HttpResponseBadRequest() *HttpResponse
- func (h *BaseHandler) HttpResponseForbidden() *HttpResponse
- func (h *BaseHandler) HttpResponseGone() *HttpResponse
- func (h *BaseHandler) HttpResponseNotAllowed() *HttpResponse
- func (h *BaseHandler) HttpResponseNotFound() *HttpResponse
- func (h *BaseHandler) HttpResponseNotModified() *HttpResponse
- func (h *BaseHandler) HttpResponseServerError() *HttpResponse
- func (h *BaseHandler) Options(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) Patch(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) PermanentRedirect(request *HttpRequest, urlStr string) *HttpResponse
- func (h *BaseHandler) Post(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) Prepare(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) Put(request *HttpRequest) *HttpResponse
- func (h *BaseHandler) TemporaryRedirect(request *HttpRequest, urlStr string) *HttpResponse
- type BaseMiddleware
- type BaseMixin
- type DictObj
- func (s *DictObj) Array(key string, args ...[]interface{}) []interface{}
- func (s *DictObj) Bool(key string, args ...bool) bool
- func (s *DictObj) Exists(key string) bool
- func (s *DictObj) Float(key string, args ...float64) float64
- func (s *DictObj) Int(key string, args ...int) int
- func (s *DictObj) LoadFromFile(filepath string)
- func (s *DictObj) Set(key string, val interface{})
- func (s *DictObj) SetFromEnv(key, envKey string, args ...interface{})
- func (s *DictObj) String(key string, args ...string) string
- type HandlerInterface
- type HttpRequest
- func (r *HttpRequest) FormArray(key string) ([]string, bool)
- func (r *HttpRequest) FormFloat(key string, args ...float64) float64
- func (r *HttpRequest) FormInt(key string, args ...int64) int64
- func (r *HttpRequest) FormString(key string, args ...string) string
- func (r *HttpRequest) FormValue(key string) (string, bool)
- func (r *HttpRequest) FragmentValue() string
- func (r *HttpRequest) GetArray(key string) ([]string, bool)
- func (r *HttpRequest) GetFloat(key string, args ...float64) float64
- func (r *HttpRequest) GetInt(key string, args ...int64) int64
- func (r *HttpRequest) GetString(key string, args ...string) string
- func (r *HttpRequest) GetValue(key string) (string, bool)
- func (r *HttpRequest) IsSecure() bool
- func (r *HttpRequest) PathValue(key string) (string, bool)
- type HttpResponse
- type HttpTestResponse
- type MiddlewareInterface
- type MixinInterface
- type NotFoundHandler
- func (h *NotFoundHandler) Delete(request *HttpRequest) *HttpResponse
- func (h *NotFoundHandler) Get(request *HttpRequest) *HttpResponse
- func (h *NotFoundHandler) New() HandlerInterface
- func (h *NotFoundHandler) Options(request *HttpRequest) *HttpResponse
- func (h *NotFoundHandler) Patch(request *HttpRequest) *HttpResponse
- func (h *NotFoundHandler) Post(request *HttpRequest) *HttpResponse
- func (h *NotFoundHandler) Put(request *HttpRequest) *HttpResponse
- type PatternServeMux
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Special Debug variable... used anywhere and everywhere, so let's make it easy.
This logger will out put with the prefix "[Tango D] " when Debug mode is true.
Normal usage loggers.
View Source
var Mux = &PatternServeMux{}
View Source
var Settings = NewDictObj()
Convention will be json style settings. Try to keep it a single level deep. Key values should be lower_case_with_underscores. Ex: debug, or secret_key.
View Source
var Version = "0.0.2"
Functions ¶
func ListenAndServe ¶
func ListenAndServe()
func Middleware ¶
func Middleware(m MiddlewareInterface)
func Mixin ¶
func Mixin(m MixinInterface)
func NewTestClient ¶
func Pattern ¶
func Pattern(pat string, h HandlerInterface)
func SendMailFrom ¶
func SendMassMail ¶
func SendMassMailFrom ¶
func SetNotFoundHandler ¶
func SetNotFoundHandler(h HandlerInterface)
func VersionMap ¶
func VersionMap() [3]int
Types ¶
type BaseHandler ¶
type BaseHandler struct{}
func (*BaseHandler) Delete ¶
func (h *BaseHandler) Delete(request *HttpRequest) *HttpResponse
func (*BaseHandler) ErrorHandler ¶
func (h *BaseHandler) ErrorHandler(errorStr string) *HttpResponse
func (*BaseHandler) Finish ¶
func (h *BaseHandler) Finish(request *HttpRequest, response *HttpResponse)
func (*BaseHandler) Get ¶
func (h *BaseHandler) Get(request *HttpRequest) *HttpResponse
func (*BaseHandler) Head ¶
func (h *BaseHandler) Head(request *HttpRequest) *HttpResponse
func (*BaseHandler) HttpResponseBadRequest ¶
func (h *BaseHandler) HttpResponseBadRequest() *HttpResponse
func (*BaseHandler) HttpResponseForbidden ¶
func (h *BaseHandler) HttpResponseForbidden() *HttpResponse
func (*BaseHandler) HttpResponseGone ¶
func (h *BaseHandler) HttpResponseGone() *HttpResponse
func (*BaseHandler) HttpResponseNotAllowed ¶
func (h *BaseHandler) HttpResponseNotAllowed() *HttpResponse
func (*BaseHandler) HttpResponseNotFound ¶
func (h *BaseHandler) HttpResponseNotFound() *HttpResponse
func (*BaseHandler) HttpResponseNotModified ¶
func (h *BaseHandler) HttpResponseNotModified() *HttpResponse
func (*BaseHandler) HttpResponseServerError ¶
func (h *BaseHandler) HttpResponseServerError() *HttpResponse
func (*BaseHandler) Options ¶
func (h *BaseHandler) Options(request *HttpRequest) *HttpResponse
func (*BaseHandler) Patch ¶
func (h *BaseHandler) Patch(request *HttpRequest) *HttpResponse
func (*BaseHandler) PermanentRedirect ¶
func (h *BaseHandler) PermanentRedirect(request *HttpRequest, urlStr string) *HttpResponse
func (*BaseHandler) Post ¶
func (h *BaseHandler) Post(request *HttpRequest) *HttpResponse
func (*BaseHandler) Prepare ¶
func (h *BaseHandler) Prepare(request *HttpRequest) *HttpResponse
func (*BaseHandler) Put ¶
func (h *BaseHandler) Put(request *HttpRequest) *HttpResponse
func (*BaseHandler) TemporaryRedirect ¶
func (h *BaseHandler) TemporaryRedirect(request *HttpRequest, urlStr string) *HttpResponse
type BaseMiddleware ¶
type BaseMiddleware struct{}
func (*BaseMiddleware) ProcessRequest ¶
func (m *BaseMiddleware) ProcessRequest(request *HttpRequest) *HttpResponse
func (*BaseMiddleware) ProcessResponse ¶
func (m *BaseMiddleware) ProcessResponse(request *HttpRequest, response *HttpResponse)
type DictObj ¶
type DictObj struct {
// contains filtered or unexported fields
}
func NewDictObj ¶
func NewDictObj() DictObj
func (*DictObj) LoadFromFile ¶
func (*DictObj) SetFromEnv ¶
type HandlerInterface ¶
type HandlerInterface interface { New() HandlerInterface Head(request *HttpRequest) *HttpResponse Get(request *HttpRequest) *HttpResponse Post(request *HttpRequest) *HttpResponse Put(request *HttpRequest) *HttpResponse Patch(request *HttpRequest) *HttpResponse Delete(request *HttpRequest) *HttpResponse Options(request *HttpRequest) *HttpResponse PermanentRedirect(request *HttpRequest, urlStr string) *HttpResponse TemporaryRedirect(request *HttpRequest, urlStr string) *HttpResponse Prepare(request *HttpRequest) *HttpResponse Finish(request *HttpRequest, response *HttpResponse) ErrorHandler(errorStr string) *HttpResponse }
type HttpRequest ¶
type HttpRequest struct { http.Request BodyString string PathArgs url.Values Registry map[string]interface{} }
func NewHttpRequest ¶
func NewHttpRequest(orig *http.Request, params url.Values) *HttpRequest
func (*HttpRequest) FormFloat ¶
func (r *HttpRequest) FormFloat(key string, args ...float64) float64
func (*HttpRequest) FormString ¶
func (r *HttpRequest) FormString(key string, args ...string) string
func (*HttpRequest) FragmentValue ¶
func (r *HttpRequest) FragmentValue() string
type HttpResponse ¶
type HttpResponse struct { Content string StatusCode int ContentType string Context map[string]interface{} Header http.Header }
func NewHttpResponse ¶
func NewHttpResponse(args ...interface{}) *HttpResponse
type HttpTestResponse ¶
type HttpTestResponse struct {
*HttpResponse
}
func (*HttpTestResponse) Json ¶
func (h *HttpTestResponse) Json() interface{}
func (*HttpTestResponse) JsonMap ¶
func (h *HttpTestResponse) JsonMap() map[string]interface{}
func (*HttpTestResponse) JsonSlice ¶
func (h *HttpTestResponse) JsonSlice() []interface{}
type MiddlewareInterface ¶
type MiddlewareInterface interface { ProcessRequest(request *HttpRequest) *HttpResponse ProcessResponse(request *HttpRequest, response *HttpResponse) }
type MixinInterface ¶
type MixinInterface interface {
InitMixin()
}
type NotFoundHandler ¶
type NotFoundHandler struct{ BaseHandler }
404 - Not Found
func (*NotFoundHandler) Delete ¶
func (h *NotFoundHandler) Delete(request *HttpRequest) *HttpResponse
func (*NotFoundHandler) Get ¶
func (h *NotFoundHandler) Get(request *HttpRequest) *HttpResponse
func (*NotFoundHandler) New ¶
func (h *NotFoundHandler) New() HandlerInterface
func (*NotFoundHandler) Options ¶
func (h *NotFoundHandler) Options(request *HttpRequest) *HttpResponse
func (*NotFoundHandler) Patch ¶
func (h *NotFoundHandler) Patch(request *HttpRequest) *HttpResponse
func (*NotFoundHandler) Post ¶
func (h *NotFoundHandler) Post(request *HttpRequest) *HttpResponse
func (*NotFoundHandler) Put ¶
func (h *NotFoundHandler) Put(request *HttpRequest) *HttpResponse
type PatternServeMux ¶
type PatternServeMux struct {
// contains filtered or unexported fields
}
---
func (*PatternServeMux) ServeHTTP ¶
func (p *PatternServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP matches r.URL.Path against its routing table using the rules described above.
func (*PatternServeMux) ServeTestResponse ¶
func (p *PatternServeMux) ServeTestResponse(r *http.Request) *HttpResponse
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
addons
|
|
examples
|
|
appengine/tangoappengine
Run cmd (from one level up): 'dev_appserver.py app.yaml'
|
Run cmd (from one level up): 'dev_appserver.py app.yaml' |
settings
Run cmd: go run settings_combo.go settings.json Run cmd: go run settings_env.go Run cmd: go run settings_flags.go -debug=true -num=1234 -serve=0.0.0.0:8000 Run cmd: go run settings_json.go Run cmd: go run settings_plain.go
|
Run cmd: go run settings_combo.go settings.json Run cmd: go run settings_env.go Run cmd: go run settings_flags.go -debug=true -num=1234 -serve=0.0.0.0:8000 Run cmd: go run settings_json.go Run cmd: go run settings_plain.go |
Click to show internal directories.
Click to hide internal directories.