Documentation ¶
Overview ¶
Package config is responsible for finding, parsing and verifying the application's JSON config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigFile string
Path to the configuration file, initialized from flags
Functions ¶
This section is empty.
Types ¶
type BytesSize ¶
type BytesSize uint64
BytesSize represents size written in string format. Examples: "1m", "20g" etc. Its main purpose is to be stored and loaded from json.
func BytesSizeFromString ¶
Parses bytes size such as "1m", "15g" to BytesSize struct.
func (*BytesSize) UnmarshalJSON ¶
type CacheZoneSection ¶
type Config ¶
type Config struct { System SystemSection `json:"system"` Logging LoggingSection `json:"logging"` HTTP HTTPSection `json:"http"` CacheZones []*CacheZoneSection `json:"cache_zones"` }
the configuration type. Should contain representation for everything in config.json
func Get ¶
Finds and returns the config for the daemon. Any errors are returned as a second parameter.
type HTTPSection ¶
type HTTPSection struct { Listen string `json:"listen"` Servers []*VirtualHost `json:"virtual_hosts"` MaxHeadersSize int `json:"max_headers_size"` ReadTimeout uint32 `json:"read_timeout"` WriteTimeout uint32 `json:"write_timeout"` StatusPage string `json:"status_page"` }
All configurations conserning the HTTP
type LoggingSection ¶
Logging options
type SystemSection ¶
type SystemSection struct { Pidfile string `json:"pidfile"` Workdir string `json:"workdir"` User string `json:"user"` }
Contains system and environment configurations.
type VirtualHost ¶
type VirtualHost struct { Name string `json:"name"` UpstreamAddress string `json:"upstream_address"` CacheZone uint32 `json:"cache_zone"` CacheKey string `json:"cache_key"` // contains filtered or unexported fields }
func (*VirtualHost) GetCacheZoneSection ¶
func (vh *VirtualHost) GetCacheZoneSection() *CacheZoneSection
func (*VirtualHost) UpstreamUrl ¶
func (vh *VirtualHost) UpstreamUrl() *url.URL
Click to show internal directories.
Click to hide internal directories.