Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupLogger ¶
func SetupLogger()
/ TODO : take a prefix to know where the logs come / from. E..g "[URCHIN]" and "[URCHIN-ADMIN]"
Types ¶
type AppSettings ¶
type AppSettings struct { DatabaseAddress string `toml:"database_address"` DatabasePort int `toml:"database_port"` DatabaseUser string `toml:"database_user"` DatabasePassword string `toml:"database_password"` DatabaseName string `toml:"database_name"` WebserverPort int `toml:"webserver_port"` AdminPort int `toml:"admin_port"` ImageDirectory string `toml:"image_dir"` CacheEnabled bool `toml:"cache_enabled"` RecaptchaSiteKey string `toml:"recaptcha_sitekey,omitempty"` RecaptchaSecret string `toml:"recaptcha_secret,omitempty"` }
func ReadConfigToml ¶
func ReadConfigToml(filepath string) (AppSettings, error)
type ErrorResponse ¶
Supported responses for urchin shared between app and admin-app.
func ErrorRes ¶
func ErrorRes(msg string, err error) ErrorResponse
Convenience method to create an error response with the given message and adding the error message as well.
msg: message to add to the error response err: error occurred during process of request.
func MsgErrorRes ¶
func MsgErrorRes(msg string) ErrorResponse
Convenience method to create an error response with the given message only.
msg: message to add to the error response
type ImageIdBinding ¶
type ImageIdBinding struct { // This is the uuid of an image to be retrieved Filename string `uri:"name" binding:"required"` }
type IntIdBinding ¶
type IntIdBinding struct {
Id int `uri:"id" binding:"required"`
}
type PostIdBinding ¶
type PostIdBinding struct {
IntIdBinding
}
type StringIdBinding ¶
type StringIdBinding struct {
Id string `uri:"id" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.