Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachWatcher ¶
AttachWatcher start the watcher, if any error was produced while the starting process the application would crash you need to pass a function, this function is the function that will be executed when the watcher receive any event the type of defined on the InitializeWatcher function
func CloseWatcher ¶
Types ¶
type Config ¶
type Config struct {
ImpostersPath string `yaml:"imposters_path"`
Port int `yaml:"port"`
Host string `yaml:"host"`
CORS ConfigCORS `yaml:"cors"`
Proxy ConfigProxy `yaml:"proxy"`
Secure bool `yaml:"secure"`
Watcher bool `yaml:"watcher"`
}
Config representation of config file yaml
func NewConfigFromFile ¶
NewConfigFromFile unmarshal content of config file to initialize a Config struct
func (*Config) ConfigureProxy ¶
ConfigureProxy preparing the server with the proxy configuration that the user has indicated
type ConfigCORS ¶
type ConfigCORS struct {
Methods []string `yaml:"methods"`
Headers []string `yaml:"headers"`
Origins []string `yaml:"origins"`
ExposedHeaders []string `yaml:"exposed_headers"`
AllowCredentials bool `yaml:"allow_credentials"`
}
ConfigCORS representation of section CORS of the yaml
type ConfigProxy ¶
ConfigProxy is a representation of section proxy of the yaml
type ProxyMode ¶
type ProxyMode uint8
ProxyMode is enumeration of proxy server modes
func StringToProxyMode ¶
StringToProxyMode convert string into a ProxyMode if not exists return a none mode and an error
func (*ProxyMode) UnmarshalYAML ¶
UnmarshalYAML implementation of yaml.Unmarshaler interface