Documentation ¶
Index ¶
- func HeaderHandler(fieldKey, headerField string) func(next http.Handler) http.Handler
- type Application
- func (a *Application) GetDatabaseConnection() (connection *mgo.Session, err error)
- func (application *Application) GetSession(r *http.Request) *scs.Session
- func (application *Application) ListenAndServe(handler http.Handler) error
- func (application *Application) StartSession(w http.ResponseWriter, r *http.Request, user *model.User) (session *scs.Session, err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct { Middleware alice.Chain Logger zerolog.Logger // contains filtered or unexported fields }
Application properties of application
func LoadConfig ¶
func LoadConfig(configPath, keyPath string) (application Application, err error)
LoadConfig loads configuration file properties from configPath file and optional keyPath encryption key
func (*Application) GetDatabaseConnection ¶
func (a *Application) GetDatabaseConnection() (connection *mgo.Session, err error)
GetDatabaseConnection gets connection to database
func (*Application) GetSession ¶
func (application *Application) GetSession(r *http.Request) *scs.Session
GetSession returns the session from the request
func (*Application) ListenAndServe ¶
func (application *Application) ListenAndServe(handler http.Handler) error
ListenAndServe starts http server with supplied handler
func (*Application) StartSession ¶
func (application *Application) StartSession(w http.ResponseWriter, r *http.Request, user *model.User) (session *scs.Session, err error)
StartSession creates session for given user
Click to show internal directories.
Click to hide internal directories.