Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultListenAddress = "0.0.0.0:8080"
Variables ¶
View Source
var ErrInvalidListenAddress = errors.New("invalid listen address")
Functions ¶
func ValidateConfig ¶
ValidateConfig validates the server configuration
Types ¶
type CORS ¶
type CORS struct {
// A list of origins a cross-domain request can be executed from.
// If the special '*' value is present in the list, all origins will be allowed.
// An origin may contain a wildcard (*) to replace 0 or more characters (i.e.: http://*.domain.com).
// Only one wildcard can be used per origin
AllowedOrigins []string `toml:"cors_allowed_origins"`
// A list of non-simple headers the client is allowed to use with cross-domain requests
AllowedHeaders []string `toml:"cors_allowed_headers"`
// A list of methods the client is allowed to use with cross-domain requests
AllowedMethods []string `toml:"cors_allowed_methods"`
}
CORS defines the server CORS configuration
func DefaultCORSConfig ¶
func DefaultCORSConfig() *CORS
DefaultCORSConfig returns the default CORS configuration
type Config ¶
type Config struct {
// The associated CORS config, if any
CORSConfig *CORS `toml:"cors_config"`
// The address at which the server will be served.
// Format should be: <IP>:<PORT>
ListenAddress string `toml:"listen_address"`
}
Config defines the base-level server configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default server configuration
Click to show internal directories.
Click to hide internal directories.