Documentation ¶
Index ¶
- func NewServer() (mh2server.Server, error)
- type ChaosMonkey
- type Config
- type Jim
- func (j *Jim) Accept(context string, conn net.Conn) bool
- func (j *Jim) Disconnect(context string) bool
- func (j *Jim) LinkSpeed(context string) *linkio.Throughput
- func (j *Jim) ValidAUTH(context string, mechanism string, args ...string) bool
- func (j *Jim) ValidMAIL(context string, mail string) bool
- func (j *Jim) ValidRCPT(context string, rcpt string) bool
- type JimConfig
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChaosMonkey ¶
type ChaosMonkey interface { // Accept is called for each incoming connection. Returning false closes the connection. Accept(ctx string, conn net.Conn) bool // LinkSpeed sets the maximum connection throughput (in one direction) LinkSpeed(ctx string) *linkio.Throughput // ValidRCPT is called for the RCPT command. Returning false signals an invalid recipient. ValidRCPT(ctx, rcpt string) bool // ValidMAIL is called for the MAIL command. Returning false signals an invalid sender. ValidMAIL(ctx, mail string) bool // ValidAUTH is called after authentication. Returning false signals invalid authentication. ValidAUTH(ctx, mechanism string, args ...string) bool // Disconnect is called after every read. Returning true will close the connection. Disconnect(ctx string) bool }
ChaosMonkey should be implemented by chaos monkeys!
type Config ¶
type Config struct { BindAddr string `env:"MH2_SMTP_BIND_ADDR"` Hostname string `env:"MH2_SMTP_HOSTNAME"` LogData bool `env:"MH2_LOG_DATA"` LogProto bool `env:"MH2_LOG_PROTO"` Backend string `env:"MH2_BACKEND"` RecordSessionData bool `env:"MH2_RECORD_SESSION_DATA"` RecordSessionProto bool `env:"MH2_RECORD_SESSION_PROTO"` RecordSessionEvents bool `env:"MH2_RECORD_SESSION_EVENTS"` Jim JimConfig }
Config is the SMTP server configuration
type Jim ¶
type Jim struct {
JimConfig
}
Jim is a chaos monkey
func (*Jim) Disconnect ¶
Disconnect implements ChaosMonkey.Disconnect
func (*Jim) LinkSpeed ¶
func (j *Jim) LinkSpeed(context string) *linkio.Throughput
LinkSpeed implements ChaosMonkey.LinkSpeed
type JimConfig ¶
type JimConfig struct { Enabled bool `env:"JIM_ENABLED"` DisconnectChance float64 `env:"JIM_DISCONNECT_CHANCE"` AcceptChance float64 `env:"JIM_ACCEPT_CHANCE"` LinkSpeedAffect float64 `env:"JIM_LINKSPEED_AFFECT"` LinkSpeedMin float64 `env:"JIM_LINKSPEED_MIN"` LinkSpeedMax float64 `env:"JIM_LINKSPEED_MAX"` RejectSenderChance float64 `env:"JIM_REJECT_SENDER_CHANCE"` RejectRecipientChance float64 `env:"JIM_REJECT_RECIPIENT_CHANCE"` RejectAuthChance float64 `env:"JIM_REJECT_AUTH_CHANCE"` }
JimConfig is the Jim chaos monkey configuration
Click to show internal directories.
Click to hide internal directories.