Documentation ¶
Index ¶
- func HandleErr(err error, ctx *gin.Context) bool
- func HasAnyPrefix(s string, prefixes ...string) bool
- func HasAnySuffix(s string, suffixes ...string) bool
- func RandomString(n int) string
- func TrimPrefixesRecursive(s string, prefixes ...string) (r string)
- type Configuration
- type ErrorResponse
- type Image
- type ImageCreated
- type Redirect
- type RedirectCreated
- type Text
- type TextCreated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasAnyPrefix ¶
func HasAnySuffix ¶
func RandomString ¶
func TrimPrefixesRecursive ¶
Types ¶
type Configuration ¶
type Configuration struct { Webserver struct { Address string `yaml:"address"` Port int `yaml:"port"` BaseURL string `yaml:"base-url"` NotFoundRedirect string `yaml:"not-found-redirect"` } `yaml:"web-server"` Features struct { EnableRedirector bool `yaml:"enable-redirector"` EnableImages bool `yaml:"enable-images"` EnableText bool `yaml:"enable-text"` EnableFiles bool `yaml:"enable-files"` API struct { EnableAPI bool `yaml:"enable-api"` EnableAuth bool `yaml:"enable-auth"` AuthToken string `yaml:"auth-token"` ManageRedirects bool `yaml:"manage-redirects"` ManageImages bool `yaml:"manage-images"` ManageText bool `yaml:"manage-text"` ManageFiles bool `yaml:"manage-files"` } `yaml:"api"` Extra struct { CompressImages bool `yaml:"compress-images"` UseRawImageURL bool `yaml:"use-raw-image-url"` } `yaml:"extra"` } `yaml:"features"` Pages struct { PageTitles struct { TextTitle string `yaml:"text-title"` ImageTitle string `yaml:"image-title"` } `yaml:"page-titles"` } `yaml:"pages"` MongoDB struct { URI string `yaml:"uri"` Host string `yaml:"host"` Port int `yaml:"port"` UseSRV bool `yaml:"use-srv"` User string `yaml:"user"` Pass string `yaml:"pass"` AuthSource string `yaml:"auth-source"` UseAuth bool `yaml:"use-auth"` DB string `yaml:"db"` } `yaml:"mongodb"` }
func LoadConfiguration ¶
func LoadConfiguration(fileLocation string) (conf *Configuration, err error)
func (*Configuration) GetURI ¶
func (conf *Configuration) GetURI() string
func (*Configuration) GetWebserverAddress ¶
func (conf *Configuration) GetWebserverAddress() string
type ErrorResponse ¶
type ImageCreated ¶
type RedirectCreated ¶
type TextCreated ¶
Click to show internal directories.
Click to hide internal directories.