Documentation ¶
Index ¶
- Variables
- func InitTemplates(path string)
- func RemoveFile(f string) error
- func RenderTemplate(w http.ResponseWriter, template string, data interface{})
- func ThrowInternalServerError(w http.ResponseWriter)
- func UploadSavePhoto(f io.Reader, name string, mediaConfig MediaConfig) (string, string, error)
- type Config
- type Configuration
- type DatabaseConfig
- type ErrorInfo
- type MediaConfig
- type PageInfo
- type TemplateConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CurrentVersion string CurrentBranch string )
View Source
var ( // ErrBadContentType is returned when the server gets an unexpected // content type. ErrBadContentType = errors.New("wrong content type") )
Functions ¶
func InitTemplates ¶
func InitTemplates(path string)
InitTemplates parses the templates and panics if it can't
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, template string, data interface{})
RenderTemplate writes a template to a Response Panics if the templates haven't been initialized.
func ThrowInternalServerError ¶
func ThrowInternalServerError(w http.ResponseWriter)
func UploadSavePhoto ¶
UploadSavePhoto saves an uploaded file to the filesystem.
Types ¶
type Configuration ¶
type Configuration struct { App Config DB DatabaseConfig `yaml:"database"` Templates TemplateConfig Media MediaConfig }
A Configuration is the main config object.
type DatabaseConfig ¶
A DatabaseConfig holds database-specific configuration.
type MediaConfig ¶
An UploadConfig holds upload-specific configuration.
type PageInfo ¶
type PageInfo struct { // Username is populated if the user is logged in Username *string // Error is populated if an error message should be shown Error []string }
PageInfo holds pieces of information that slot into standard placeholders on pages. Any field nay be null if applicable
type TemplateConfig ¶
type TemplateConfig struct {
Path string
}
A TemplateConfig holds template-specific configuration.
Click to show internal directories.
Click to hide internal directories.