Versions in this module Expand all Collapse all v1 v1.6.1 Dec 28, 2019 v1.6.0 May 4, 2019 Changes in this version + const ClientCmd + const ClientData + const ClientGreeting + const ClientShutdown + const ClientStartTLS + const CommandLineMaxLength + const CommandVerbMaxLength + const MaxUnrecognizedCommands + const ServerStateNew + const ServerStateRunning + const ServerStateStartError + const ServerStateStopped + var BuildTime string + var Commit string + var ConfigLoadTime time.Time + var ErrPoolShuttingDown = errors.New("server pool: shutting down") + var LineLimitExceeded = errors.New("maximum line length exceeded") + var MessageSizeExceeded = errors.New("maximum message size exceeded") + var StartTime time.Time + var TLSCiphers = map[string]uint16 + var TLSClientAuthTypes = map[string]tls.ClientAuthType + var TLSCurves = map[string]tls.CurveID + var TLSProtocols = map[string]uint16 + var Version string + func CheckFileLimit(c *AppConfig) (bool, int, uint64) + func NewClient(conn net.Conn, clientID uint64, logger log.Logger, envelope *mail.Pool) *client + type AppConfig struct + AllowedHosts []string + BackendConfig backends.BackendConfig + LogFile string + LogLevel string + PidFile string + Servers []ServerConfig + func (c *AppConfig) EmitChangeEvents(oldConfig *AppConfig, app Guerrilla) + func (c *AppConfig) EmitLogReopenEvents(app Guerrilla) + func (c *AppConfig) Load(jsonBytes []byte) error + type ClientState int + type Daemon struct + Backend backends.Backend + Config *AppConfig + Logger log.Logger + func (d *Daemon) AddProcessor(name string, pc backends.ProcessorConstructor) + func (d *Daemon) LoadConfig(path string) (AppConfig, error) + func (d *Daemon) Log() log.Logger + func (d *Daemon) Publish(topic Event, args ...interface{}) + func (d *Daemon) ReloadConfig(c AppConfig) error + func (d *Daemon) ReloadConfigFile(path string) error + func (d *Daemon) ReopenLogs() error + func (d *Daemon) SetConfig(c AppConfig) error + func (d *Daemon) Shutdown() + func (d *Daemon) Start() (err error) + func (d *Daemon) Subscribe(topic Event, fn interface{}) error + func (d *Daemon) Unsubscribe(topic Event, handler interface{}) error + type Errors []error + func (e Errors) Error() string + type Event int + const EventConfigAllowedHosts + const EventConfigBackendConfig + const EventConfigLogFile + const EventConfigLogLevel + const EventConfigLogReopen + const EventConfigNewConfig + const EventConfigPidFile + const EventConfigServerConfig + const EventConfigServerLogFile + const EventConfigServerLogReopen + const EventConfigServerMaxClients + const EventConfigServerNew + const EventConfigServerRemove + const EventConfigServerStart + const EventConfigServerStop + const EventConfigServerTLSConfig + const EventConfigServerTimeout + func (e Event) String() string + type EventHandler struct + func (h *EventHandler) Publish(topic Event, args ...interface{}) + func (h *EventHandler) Subscribe(topic Event, fn interface{}) error + func (h *EventHandler) Unsubscribe(topic Event, handler interface{}) error + type Guerrilla interface + Publish func(topic Event, args ...interface{}) + SetLogger func(log.Logger) + Shutdown func() + Start func() error + Subscribe func(topic Event, fn interface{}) error + Unsubscribe func(topic Event, handler interface{}) error + func New(ac *AppConfig, b backends.Backend, l log.Logger) (Guerrilla, error) + type Pool struct + ShutdownChan chan int + func NewPool(poolSize int) *Pool + func (p *Pool) Borrow(conn net.Conn, clientID uint64, logger log.Logger, ep *mail.Pool) (Poolable, error) + func (p *Pool) GetActiveClientsCount() int + func (p *Pool) IsShuttingDown() bool + func (p *Pool) Return(c Poolable) + func (p *Pool) SetTimeout(duration time.Duration) + func (p *Pool) ShutdownState() + func (p *Pool) ShutdownWait() + func (p *Pool) Start() + type Poolable interface + type ServerConfig struct + Hostname string + IsEnabled bool + ListenInterface string + LogFile string + MaxClients int + MaxSize int64 + TLS ServerTLSConfig + Timeout int + XClientOn bool + func (sc *ServerConfig) Validate() error + type ServerTLSConfig struct + AlwaysOn bool + Ciphers []string + ClientAuthType string + Curves []string + PreferServerCipherSuites bool + PrivateKeyFile string + Protocols []string + PublicKeyFile string + RootCAs string + StartTLSOn bool