Documentation ¶
Overview ¶
Package middlewares is a group of functions. They mutualize some actions common to many gin handlers, like checking authentication or permissions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInstance ¶
func SetInstance() gin.HandlerFunc
SetInstance creates a gin middleware to put the instance in the gin context for next handlers
Types ¶
type Instance ¶
type Instance struct { Domain string // The main DNS domain, like example.cozycloud.cc StorageURL string // Where the binaries are persisted // contains filtered or unexported fields }
An Instance has the informations relatives to the logical cozy instance, like the domain, the locale or the access to the databases and files storage
func GetInstance ¶
GetInstance will return the instance linked to the given gin context or panic if none exists
func (*Instance) GetDatabasePrefix ¶
GetDatabasePrefix returns the prefix to use in database naming for the current instance
Click to show internal directories.
Click to hide internal directories.