Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheLastPasswordSent ¶
type CacheLastPasswordSent struct {
// contains filtered or unexported fields
}
CacheLastPasswordSent stores information about when we last sent password cracked emails for a specific task
func NewCache ¶
func NewCache(expireAfter time.Duration) *CacheLastPasswordSent
NewCache creates a password notification sent cache
func (*CacheLastPasswordSent) CanSendEmail ¶
func (s *CacheLastPasswordSent) CanSendEmail(taskID string) bool
CanSendEmail returns a boolean indicating if we're able to send an email. If checks to see if the taskid exists in a lookup table which stores the last time an email was sent out for the taskid. If a value exists in the table and it's greater than the expiration, it will be reset to the current time and return true. If the lookup fails, it will set the current time for the task and return true.
func (*CacheLastPasswordSent) Stop ¶
func (s *CacheLastPasswordSent) Stop()
Stop the password cache expiration goroutine
type Config ¶
type Config struct { EmailServer struct { Address string `yaml:"address"` Port int `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` SkipInvalidCert bool `yaml:"skip_invalid_cert"` Certifcate *string `yaml:"certificate"` ServerName *string `yaml:"server_name"` } `yaml:"email_server"` Enabled bool `yaml:"enabled"` FromAddress string `yaml:"from_address"` PublicAddress string `yaml:"public_address"` }
Config describes the available configuration options for the email notification engine
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a context that provides notification capabilities via email
func (*Engine) CrackedPassword ¶
CrackedPassword is called whenever a password has been cracked and will send out a notification email if one can be sent.
func (*Engine) TaskStatusChanged ¶
func (s *Engine) TaskStatusChanged(taskID string, newStatus storage.TaskStatus) error
TaskStatusChanged is called whenever a task status has changed