Documentation ¶
Overview ¶
Package config provides configuration object for NVGD.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFilter ¶ added in v1.8.0
func RegisterFilter(name string, v interface{})
RegisterFilter registers a filter configuration.
func RegisterProtocol ¶
func RegisterProtocol(name string, v interface{})
RegisterProtocol registers protocol configuration.
Types ¶
type Config ¶
type Config struct { Addr string `yaml:"addr"` PathPrefix string `yaml:"path_prefix"` // ErrorLogPath specify path of access log. default is "(stderr)". ErrorLogPath string `yaml:"error_log"` // AccessLogPath specify path of access log. default is "(discard)". AccessLogPath string `yaml:"access_log"` // RootContentsFile specify file path which be served as "/" (root). // default is empty and no contents are served as "/". RootContentsFile string `yaml:"root_contents_file"` Protocols customConfig `yaml:"protocols,omitempty"` Filters customConfig `yaml:"filters,omitempty"` DefaultFilters FiltersMap `yaml:"default_filters,omitempty"` // Aliases provides custom aliases. Aliases map[string]string `yaml:"aliases,omitempty"` // AccessControlAllowOrigin specify a value for // "Access-Control-Allow-Origin" header put to all responses. // The header is not put when this is empty string. // Default value is empty. AccessControlAllowOrigin string `yaml:"access_control_allow_origin,omitempty"` }
Config represents NVGD server configuration.
func LoadConfig ¶
LoadConfig loads a configuration from a file.
Click to show internal directories.
Click to hide internal directories.