mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-24 14:54:03 +00:00
29 lines
922 B
Go
29 lines
922 B
Go
|
package monkey
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
|
||
|
"github.com/ian-kent/linkio"
|
||
|
)
|
||
|
|
||
|
// ChaosMonkey should be implemented by chaos monkeys!
|
||
|
type ChaosMonkey interface {
|
||
|
RegisterFlags()
|
||
|
Configure(func(string, ...interface{}))
|
||
|
|
||
|
// Accept is called for each incoming connection. Returning false closes the connection.
|
||
|
Accept(conn net.Conn) bool
|
||
|
// LinkSpeed sets the maximum connection throughput (in one direction)
|
||
|
LinkSpeed() *linkio.Throughput
|
||
|
|
||
|
// ValidRCPT is called for the RCPT command. Returning false signals an invalid recipient.
|
||
|
ValidRCPT(rcpt string) bool
|
||
|
// ValidMAIL is called for the MAIL command. Returning false signals an invalid sender.
|
||
|
ValidMAIL(mail string) bool
|
||
|
// ValidAUTH is called after authentication. Returning false signals invalid authentication.
|
||
|
ValidAUTH(mechanism string, args ...string) bool
|
||
|
|
||
|
// Disconnect is called after every read. Returning true will close the connection.
|
||
|
Disconnect() bool
|
||
|
}
|