Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultSMTPAddr = "127.0.0.1:1025" DefaultHookAddr = "127.0.0.1:7790" DefaultAPIAddr = "127.0.0.1:8091" DefaultCap = 500 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Kind string `json:"kind"` // "mail" | "hook"
Data json.RawMessage `json:"data"`
}
Event is the wire format used by /tail and the in-process pub/sub bus.
type Hook ¶
type Hook struct {
ID string `json:"id"`
Time time.Time `json:"time"`
Method string `json:"method"`
Path string `json:"path"`
Query string `json:"query"`
Headers map[string][]string `json:"headers"`
Body string `json:"body"`
Remote string `json:"remote"`
}
Hook is a captured HTTP request.
type Mail ¶
type Mail struct {
ID string `json:"id"`
Time time.Time `json:"time"`
From string `json:"from"`
To []string `json:"to"`
Subject string `json:"subject"`
Headers map[string]string `json:"headers"`
Body string `json:"body"` // preferred display body (text if present, else html)
Text string `json:"text,omitempty"` // text/plain part (decoded)
HTML string `json:"html,omitempty"` // text/html part (decoded)
Raw string `json:"raw"`
}
Mail is a captured SMTP message after MIME parsing.
type Rule ¶
type Rule struct {
ID string `json:"id"`
Created time.Time `json:"created"`
Method string `json:"method"`
Path string `json:"path"`
Status int `json:"status"`
Headers map[string]string `json:"headers,omitempty"`
Body string `json:"body,omitempty"`
DelayMs int `json:"delay_ms,omitempty"`
}
Rule is a Beeceptor-style mock response. Incoming hook requests matching Method+Path get this response instead of the default. Captures still happen.
- Method "" or "*" matches any method (case-insensitive otherwise).
- Path "" or "*" matches any path. Trailing "/*" matches any subpath.
- Newest-added rule wins on tie.
Click to show internal directories.
Click to hide internal directories.