Documentation ¶
Index ¶
- func Redirect(to string) func(c *Context)
- func Walk(fs http.FileSystem, base string, ...) error
- type CompoundOptions
- type Context
- func (c *Context) Error(code int, msg string)
- func (c *Context) ErrorObject(code int, obj interface{})
- func (c *Context) Form() (*Options, error)
- func (c *Context) GetObject(obj interface{}) error
- func (c *Context) GetRequest() *http.Request
- func (c *Context) GetUser() string
- func (c *Context) ParseVars() *Options
- func (c *Context) QueryHas(key string) bool
- func (c *Context) QueryValue(key string) string
- func (c *Context) QueryValueWithDefault(key string, def string) string
- func (c *Context) ReadObject(object interface{}) error
- func (c *Context) Redirect(url string)
- func (c *Context) Render(tmpl string, content interface{})
- func (c *Context) RenderEx(tmpl string, content interface{})
- func (c *Context) RenderWithMeta(tmpl string, meta map[string]string, content interface{})
- func (c *Context) Reply(msg string)
- func (c *Context) ReplyObject(obj interface{})
- func (c *Context) ReplyWithHeaders(msg string, kv map[string]string)
- func (c *Context) Writer() http.ResponseWriter
- type Form
- type FormValueProvider
- type Options
- func (o *Options) GetVar(k string) (string, bool)
- func (o *Options) GetVarAsSlice(k string, delim string, def []string) []string
- func (o *Options) GetVarDefault(k string, def string) string
- func (o *Options) StringSlice(k string, delim string) ([]string, bool)
- func (o *Options) StringValue(k string) (string, bool)
- func (o *Options) TimeValue(key, timeFormat string, defaultValue *time.Time) time.Time
- func (o *Options) Uint64Value(k string) (uint64, bool)
- type OptionsProvider
- type Query
- type RouteBuilder
- func (r *RouteBuilder) BuildRoute(s *Server) http.HandlerFunc
- func (r *RouteBuilder) WithAuth(auth auth.Authenticator) *RouteBuilder
- func (r *RouteBuilder) WithContent(contentHandler func(c *Context)) *RouteBuilder
- func (r *RouteBuilder) WithLoginHandler(loginHandler func(c *Context) bool) *RouteBuilder
- type Server
- func (s *Server) AddRoute(path string, r *RouteBuilder) *mux.Route
- func (s *Server) Dump()
- func (s *Server) EnableStatus(path string)
- func (s *Server) EnableTestMode(enable bool) *Server
- func (s *Server) HandleFunc(path string, f func(c *Context)) *mux.Route
- func (s *Server) HandleFuncAuthenticated(path, redirect string, f func(c *Context)) *mux.Route
- func (s *Server) HandleFuncAuthenticatedWithLogin(path string, loginHandler func(c *Context) bool, ...) *mux.Route
- func (s *Server) HandleFuncCustomAuth(auth auth.Authenticator, path, redirect string, f func(c *Context)) *mux.Route
- func (s *Server) HandleServiceFunc(path string, f func(c *ServiceRequest) *ServiceResponse) *mux.Route
- func (s *Server) HandleServiceFuncWithAuth(path string, f func(c *ServiceRequest) *ServiceResponse) *mux.Route
- func (s *Server) LoadTemplatesFS(fs http.FileSystem, base string) (*template.Template, error)
- func (s *Server) Router() *mux.Router
- func (s *Server) Serve() error
- func (s *Server) ServeTLS(keyPath string, certPath string) error
- func (s *Server) ServeTLSRedirect(address string) error
- func (s *Server) SetDebug(enable bool)
- func (s *Server) SetTemplatePath(tmplPath string)
- func (s *Server) SetTheme(themePath string)
- func (s *Server) Shutdown(ctx context.Context)
- func (s *Server) WithAuth(auth auth.Authenticator) *Server
- func (s *Server) WithDebug(debugURL string) *Server
- func (s *Server) WithHealthCheck(version, date string, status func() (bool, string))
- func (s *Server) WithMetadata(meta map[string]string) *Server
- func (s *Server) WithRootFileSystem(fs http.FileSystem) *Server
- func (s *Server) WithStaticFiles(prefix string) *Server
- func (s *Server) WithTemplateFuncs(funcs template.FuncMap) *Server
- func (s *Server) WithTheme(themeURL string) *Server
- type ServiceRequest
- func (c *ServiceRequest) Form() (*Options, error)
- func (c *ServiceRequest) GetObject(object interface{}) error
- func (c *ServiceRequest) GetRequest() *http.Request
- func (c *ServiceRequest) GetUser() string
- func (c *ServiceRequest) Options() *Options
- func (c *ServiceRequest) Query() *Options
- func (c *ServiceRequest) ReplyMessage(code int, msg string) *ServiceResponse
- func (c *ServiceRequest) ReplyObject(code int, obj interface{}) *ServiceResponse
- func (c *ServiceRequest) Vars() *Options
- type ServiceResponse
- type ServiceStatus
- type SnapBaseContent
- type SnapContent
- type Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompoundOptions ¶
type CompoundOptions struct {
// contains filtered or unexported fields
}
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) ErrorObject ¶
func (*Context) GetRequest ¶
func (*Context) QueryValue ¶
func (*Context) QueryValueWithDefault ¶
func (*Context) ReadObject ¶
func (*Context) RenderWithMeta ¶
func (*Context) ReplyObject ¶
func (c *Context) ReplyObject(obj interface{})
func (*Context) ReplyWithHeaders ¶
func (*Context) Writer ¶
func (c *Context) Writer() http.ResponseWriter
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
Form wraps utility functions around HTTP Form values
type FormValueProvider ¶
FormValueProvider we only care about something that can provide us the K/V lookup
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) GetVarAsSlice ¶
func (*Options) StringSlice ¶
StringSlice returns multiple values assigned to the same key as a string slice
func (*Options) StringValue ¶
StringValue returns form value as a string
type OptionsProvider ¶
type RouteBuilder ¶
type RouteBuilder struct {
// contains filtered or unexported fields
}
func NewRouteBuilder ¶
func NewRouteBuilder() *RouteBuilder
func (*RouteBuilder) BuildRoute ¶
func (r *RouteBuilder) BuildRoute(s *Server) http.HandlerFunc
func (*RouteBuilder) WithAuth ¶
func (r *RouteBuilder) WithAuth(auth auth.Authenticator) *RouteBuilder
func (*RouteBuilder) WithContent ¶
func (r *RouteBuilder) WithContent(contentHandler func(c *Context)) *RouteBuilder
func (*RouteBuilder) WithLoginHandler ¶
func (r *RouteBuilder) WithLoginHandler(loginHandler func(c *Context) bool) *RouteBuilder
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) EnableStatus ¶
func (*Server) EnableTestMode ¶
func (*Server) HandleFuncAuthenticated ¶
func (*Server) HandleFuncAuthenticatedWithLogin ¶
func (*Server) HandleFuncCustomAuth ¶
func (*Server) HandleServiceFunc ¶
func (s *Server) HandleServiceFunc(path string, f func(c *ServiceRequest) *ServiceResponse) *mux.Route
func (*Server) HandleServiceFuncWithAuth ¶
func (s *Server) HandleServiceFuncWithAuth(path string, f func(c *ServiceRequest) *ServiceResponse) *mux.Route
func (*Server) LoadTemplatesFS ¶
func (*Server) ServeTLSRedirect ¶
func (*Server) SetTemplatePath ¶
func (*Server) WithHealthCheck ¶
func (*Server) WithRootFileSystem ¶
func (s *Server) WithRootFileSystem(fs http.FileSystem) *Server
func (*Server) WithStaticFiles ¶
func (*Server) WithTemplateFuncs ¶
type ServiceRequest ¶
type ServiceRequest struct {
// contains filtered or unexported fields
}
func (*ServiceRequest) Form ¶
func (c *ServiceRequest) Form() (*Options, error)
func (*ServiceRequest) GetObject ¶
func (c *ServiceRequest) GetObject(object interface{}) error
func (*ServiceRequest) GetRequest ¶
func (c *ServiceRequest) GetRequest() *http.Request
func (*ServiceRequest) GetUser ¶
func (c *ServiceRequest) GetUser() string
func (*ServiceRequest) Options ¶
func (c *ServiceRequest) Options() *Options
Options get compound options
func (*ServiceRequest) Query ¶
func (c *ServiceRequest) Query() *Options
func (*ServiceRequest) ReplyMessage ¶
func (c *ServiceRequest) ReplyMessage(code int, msg string) *ServiceResponse
func (*ServiceRequest) ReplyObject ¶
func (c *ServiceRequest) ReplyObject(code int, obj interface{}) *ServiceResponse
func (*ServiceRequest) Vars ¶
func (c *ServiceRequest) Vars() *Options
type ServiceResponse ¶
func (*ServiceResponse) WriteResponse ¶
func (s *ServiceResponse) WriteResponse(w http.ResponseWriter)
type ServiceStatus ¶
type ServiceStatus struct {
Message string
}
type SnapBaseContent ¶
type SnapBaseContent struct { Theme string Content interface{} }
type SnapContent ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.