Documentation ¶
Index ¶
- type ConfigLoader
- type Configuration
- type ConfigurationYaml
- type FrontProxyYaml
- type Site
- type SiteYaml
- func (site *SiteYaml) Description() string
- func (site *SiteYaml) FaviconPath() string
- func (site *SiteYaml) GRef() string
- func (site *SiteYaml) Host() string
- func (site *SiteYaml) IPHeader() string
- func (site *SiteYaml) KeepLinks() bool
- func (site *SiteYaml) Language() string
- func (site *SiteYaml) Redirects() []string
- func (site *SiteYaml) Ref() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigLoader ¶
type ConfigLoader func() (Configuration, error)
ConfigLoader is a function that can load a configuration from specific manner, i.e. NewYamlConfigLoader
func NewYamlConfigLoader ¶
func NewYamlConfigLoader(filename string) ConfigLoader
NewYamlConfigLoader returns a loader for a given YAML configuration file
type Configuration ¶
Configuration represents the setup of the whole GGSP
type ConfigurationYaml ¶
type ConfigurationYaml struct { PortField uint16 `yaml:"port"` SitesField []*SiteYaml `yaml:"sites"` IndexField bool `yaml:"index"` }
ConfigurationYaml is a structure that will be automatically populated with the value of the configuration
func (*ConfigurationYaml) Index ¶
func (config *ConfigurationYaml) Index() bool
Index returns true if an index should be displayed when neither a host or a redirect was found
func (*ConfigurationYaml) Port ¶
func (config *ConfigurationYaml) Port() uint16
Port return the port to which the daemon will listen to
func (*ConfigurationYaml) Sites ¶
func (config *ConfigurationYaml) Sites() []Site
Sites returns the list of sites
type FrontProxyYaml ¶
FrontProxyYaml is a structure that will be automatically populated with the value of the configuration
type Site ¶
type Site interface { Ref() string Host() string Description() string Redirects() []string Language() string KeepLinks() bool FaviconPath() string GRef() string IPHeader() string }
Site represents the settings of a specific site
type SiteYaml ¶
type SiteYaml struct { RefField string `yaml:"ref"` HostField string `yaml:"host"` DescriptionField string `yaml:"description"` RedirectsField []string `yaml:"redirects"` LanguageField string `yaml:"language"` KeepLinksField bool `yaml:"keeplinks"` FaviconPathField string `yaml:"faviconpath"` FrontProxyField *FrontProxyYaml `yaml:"frontproxy"` }
SiteYaml is a structure that will be automatically populated with the value of the configuration
func (*SiteYaml) Description ¶
Description returns a string describing the content of the site
func (*SiteYaml) FaviconPath ¶
FaviconPath returns the path to the favicon file. No file is assumed if the string is empty
func (*SiteYaml) IPHeader ¶
IPHeader returns the HTTP header containing the ip of the requester, if empty this information will be taken from the connection directly