Documentation ¶
Index ¶
- func AddBackgroundProcess(f func() error)
- func AddBatchProcess(f func() error)
- func AddFunc(n string, f interface{})
- func AddStartup(s func())
- func GetSessionVar(r *http.Request, name string) interface{}
- func Log(method *string, ip *string, text string, result int)
- func Panic(method *string, ip *string, text string, result int)
- func RemoveAllSessionVars(r *http.Request, w http.ResponseWriter)
- func RemoveSessionVar(r *http.Request, w http.ResponseWriter, name string)
- func RunApp(r func(*mux.Router))
- func Session(r *http.Request) (*sessions.Session, error)
- func SessionName() string
- func SetErrorMiddleware(f func(w http.ResponseWriter, r *http.Request, err error) bool)
- func SetMiddleware(f func(w http.ResponseWriter, r *http.Request) bool)
- func SetSessionVar(r *http.Request, w http.ResponseWriter, name string, value interface{})
- type Config
- type DatabaseConfig
- type LogMsg
- type Parameter
- type ParameterGroup
- type Request
- type Response
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBackgroundProcess ¶
func AddBackgroundProcess(f func() error)
AddBackgroundProcess adds a function that will be executed in the background
func AddBatchProcess ¶
func AddBatchProcess(f func() error)
AddBatchProcess adds a function to be executed once a day
func GetSessionVar ¶
GetSessionVar returns the value of the specified session variable
func RemoveAllSessionVars ¶
func RemoveAllSessionVars(r *http.Request, w http.ResponseWriter)
RemoveAllSessionVars clears all the session variables
func RemoveSessionVar ¶
func RemoveSessionVar(r *http.Request, w http.ResponseWriter, name string)
RemoveSessionVar removes the session variable
func SetErrorMiddleware ¶
SetErrorMiddleware sets the custom error handler Return true if the error middleware handles the request
func SetMiddleware ¶
func SetMiddleware(f func(w http.ResponseWriter, r *http.Request) bool)
SetMiddleware sets the custom middleware Return true if the middleware handles the request
func SetSessionVar ¶
func SetSessionVar(r *http.Request, w http.ResponseWriter, name string, value interface{})
SetSessionVar sets and saves the session variable
Types ¶
type Config ¶
type Config struct { Server ServerConfig `json:"server"` Database DatabaseConfig `json:"database"` Secret string `json:"secret"` ApplicationName string `json:"appname"` ShowLog bool `json:"showlog"` }
Config is the application configuration
type DatabaseConfig ¶
type DatabaseConfig struct { Server string `json:"server"` Port int `json:"port"` Database string `json:"database"` User string `json:"username"` Password string `json:"password"` }
DatabaseConfig is the database configuration
type LogMsg ¶
type LogMsg struct { daggertech.Model IP string `daggertech:"size:20"` Method string `daggertech:"size:32"` Text string `daggertech:""` Result int `daggertech:""` ResultDescription string `daggertech:""` }
LogMsg is the log message to be stored in the database
type Parameter ¶
type Parameter struct { daggertech.Model Name string `daggertech:"size:64,key:true"` Value string `daggertech:""` Description string `daggertech:""` ParameterGroupID string `daggertech:"type:uuid,key:true"` }
Parameter is the table to hold the global parameters
func GetParameter ¶
GetParameter returns the parameter specified If necessary, a new parameter group is created
func (*Parameter) Set ¶
func (p *Parameter) Set(v interface{})
Set sets the value of the paraneter and automatically saves it to the database
func (Parameter) StandingData ¶
func (p Parameter) StandingData() []daggertech.Modeller
StandingData returns the standing data for when the table is created
type ParameterGroup ¶
type ParameterGroup struct { daggertech.Model Name string `daggertech:"size:64,key:true"` }
ParameterGroup is the table to hold the global parameter groupss
func (*ParameterGroup) GetParameters ¶
func (g *ParameterGroup) GetParameters() []*Parameter
GetParameters returns all the parameters for the parameter group passed as receiver
func (ParameterGroup) StandingData ¶
func (g ParameterGroup) StandingData() []daggertech.Modeller
StandingData returns the standing data for when the table is created
type Response ¶
type Response struct { http.ResponseWriter // contains filtered or unexported fields }
Response allows the status of the response to be exposed for logging
func NewResponse ¶
func NewResponse(r http.ResponseWriter) *Response
NewResponse creates a new HiveResponse
func (*Response) WriteHeader ¶
WriteHeader overrites the original method to allow retrieval of the status code