Documentation ¶
Index ¶
- Constants
- func JsonRead(body io.ReadCloser, obj interface{}, w http.ResponseWriter) bool
- func JsonWrite(w http.ResponseWriter, status int, content interface{})
- func TrueForAll(string) bool
- type AppContext
- type Application
- type CORSHandler
- type CORSMethod
- type CORSPreflight
- type CORSRouter
- type Configuration
- type Database
- type HttpAuthenticable
- type HttpBasicAuthenticator
- type Install
- type IntStringTuple
- type Languages
- type Logon
- type PredicateStringFunc
- type Session
- type StringSlice
Constants ¶
View Source
const ( DEFAULT_CORS_PREFLIGHT_METHOD = "OPTIONS" DEFAULT_CORS_MAX_AGE = time.Hour * 24 / time.Second DEFAULT_CORS_METHODS = "OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT" DEFAULT_CORS_ORIGIN = "*" )
View Source
const ( HTTP_BODY_MAX_LENGTH = 1048576 // WebDAV; RFC 4918 StatusUnprocessableEntity = 422 )
View Source
const (
BASIC_PREFIX = "Basic "
)
Variables ¶
This section is empty.
Functions ¶
func JsonRead ¶
func JsonRead(body io.ReadCloser, obj interface{}, w http.ResponseWriter) bool
func JsonWrite ¶
func JsonWrite(w http.ResponseWriter, status int, content interface{})
func TrueForAll ¶
Types ¶
type AppContext ¶
type AppContext struct {
// contains filtered or unexported fields
}
func (*AppContext) InitDb ¶
func (c *AppContext) InitDb() error
func (*AppContext) InitTokenStore ¶
func (c *AppContext) InitTokenStore() error
func (*AppContext) LoggingHandler ¶
func (c *AppContext) LoggingHandler(next http.Handler) http.Handler
func (*AppContext) SetConfiguration ¶
func (c *AppContext) SetConfiguration(cfg *Configuration)
type Application ¶
func (*Application) GetAuthTokenLifeDuration ¶
func (app *Application) GetAuthTokenLifeDuration() time.Duration
func (*Application) GetTokenLifeDuration ¶
func (app *Application) GetTokenLifeDuration() time.Duration
type CORSHandler ¶
type CORSHandler struct { PredicateOrigin PredicateStringFunc Headers []string ExposedHeaders []string }
func NewCORSHandler ¶
func NewCORSHandler() *CORSHandler
func (*CORSHandler) CreateOptionsRoutes ¶
func (s *CORSHandler) CreateOptionsRoutes(routes rqhttp.Routes) rqhttp.Routes
type CORSMethod ¶
type CORSMethod struct { CORSHandler UseCredentials bool }
func (*CORSMethod) CORSMiddleware ¶
func (s *CORSMethod) CORSMiddleware(next http.Handler) http.Handler
type CORSPreflight ¶
type CORSPreflight struct { CORSHandler Methods []string UseCredentials bool }
func (*CORSPreflight) ServeHTTP ¶
func (s *CORSPreflight) ServeHTTP(w http.ResponseWriter, r *http.Request)
type CORSRouter ¶
type CORSRouter struct { AllowOrigin PredicateStringFunc PreflightMiddleware rqhttp.HttpMiddlewareFunc // contains filtered or unexported fields }
type Configuration ¶
type Configuration struct { Application Database }
func (*Configuration) Load ¶
func (c *Configuration) Load(path string) error
type Database ¶
type Database struct { Engine string Host string Port uint16 Name string User string Password string Protocol string DbArgs string }
func (*Database) GetConnectionString ¶
type HttpAuthenticable ¶
type HttpBasicAuthenticator ¶
type HttpBasicAuthenticator struct {
HttpAuthenticable
}
type Install ¶
type Install struct {
Context *AppContext
}
func (*Install) CreateFirstUser ¶
func (self *Install) CreateFirstUser(w http.ResponseWriter, r *http.Request)
func (*Install) GetInstallStatus ¶
func (self *Install) GetInstallStatus(w http.ResponseWriter, r *http.Request)
type IntStringTuple ¶
type Languages ¶
type Languages struct {
Context *AppContext
}
func (*Languages) GetLanguages ¶
func (self *Languages) GetLanguages(w http.ResponseWriter, r *http.Request)
type PredicateStringFunc ¶
type Session ¶
type Session struct {
Context *AppContext
}
type StringSlice ¶
type StringSlice []string
func (StringSlice) Exists ¶
func (s StringSlice) Exists(str string) bool
func (StringSlice) ExistsAllIgnoreCase ¶
func (s StringSlice) ExistsAllIgnoreCase(str []string) bool
func (StringSlice) ExistsIgnoreCase ¶
func (s StringSlice) ExistsIgnoreCase(str string) bool
func (StringSlice) IndexOf ¶
func (s StringSlice) IndexOf(str string) int
func (StringSlice) IndexOfIgnoreCase ¶
func (s StringSlice) IndexOfIgnoreCase(str string) int
Click to show internal directories.
Click to hide internal directories.