Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is the standard error class for node events. Error = errs.Class("node events") )
Functions ¶
This section is empty.
Types ¶
type Chore ¶ added in v1.68.1
Chore is a chore that reads events from node events and sends emails.
func (*Chore) SetNotifier ¶ added in v1.68.1
SetNotifier sets the notifier on chore for testing.
type Config ¶ added in v1.68.1
type Config struct { Interval time.Duration `help:"how long to wait before checking the node events DB again if there is nothing to work on" default:"5m"` SelectionWaitPeriod time.Duration `` /* 130-byte string literal not displayed */ }
Config contains configurable values for node events chore.
type DB ¶
type DB interface { // Insert a node event into the node events table. Insert(ctx context.Context, email string, nodeID storj.NodeID, event Type) (nodeEvent NodeEvent, err error) // GetLatestByEmailAndEvent gets latest node event by email and event type. GetLatestByEmailAndEvent(ctx context.Context, email string, event Type) (nodeEvent NodeEvent, err error) // GetNextBatch gets the next batch of events to combine into an email. GetNextBatch(ctx context.Context, firstSeenBefore time.Time) (events []NodeEvent, err error) // UpdateEmailSent updates email_sent for a group of rows. UpdateEmailSent(ctx context.Context, ids []uuid.UUID, timestamp time.Time) (err error) }
DB implements the database for node events.
architecture: Database
type MockNotifier ¶ added in v1.68.1
type MockNotifier struct {
// contains filtered or unexported fields
}
MockNotifier implements the Notifier interface.
func NewMockNotifier ¶ added in v1.68.1
func NewMockNotifier(log *zap.Logger) *MockNotifier
NewMockNotifier is a constructor for MockNotifier.
type NodeEvent ¶
type NodeEvent struct { ID uuid.UUID Email string NodeID storj.NodeID Event Type CreatedAt time.Time EmailSent *time.Time }
NodeEvent contains information needed to notify a node operator about something that happened to a node.
type Notifier ¶ added in v1.68.1
type Notifier interface { // Notify notifies a node operator about an event that occurred on some of their nodes. Notify(ctx context.Context, satellite string, events []NodeEvent) (err error) }
Notifier notifies node operators about node events.
type Type ¶
type Type int
Type is a type of node event.
const ( // Online indicates that the node has come back online. Online Type = iota // Offline indicates that the node is offline. Offline // Disqualified indicates that the node is disqualified. Disqualified // UnknownAuditSuspended indicates that the node is suspended for unknown audit errors. UnknownAuditSuspended // UnknownAuditUnsuspended indicates that the node is no longer suspended for unknown audit errors. UnknownAuditUnsuspended // OfflineSuspended indicates that the node is suspended for being offline. OfflineSuspended // OfflineUnsuspended indicates that the node is no longer suspended for being offline. OfflineUnsuspended // BelowMinVersion indicates that the node's software is below the minimum version. BelowMinVersion )
Click to show internal directories.
Click to hide internal directories.