Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier represents a notifier.
func (*Notifier) Init ¶
func (n *Notifier) Init(ctx context.Context, projectID string, sender string, store TimeStore) error
Init initializes a notifier for use with the given project. It looks up secrets from either a file or Google Storage bucket specified by the <PROJECTID>_SECRETS environment variable. The optional (non-nil) timestore keeps track of notification times, to avoid sending too frequently. For testing, projectID and sender should be empty strings.
type TimeStore ¶
type TimeStore interface { Set(int64, string, time.Time) error // Set a time for a key. Get(int64, string) (time.Time, error) // Get a time for a key. }
TimeStore is an interface for getting and setting notification times.
func NewTimeStore ¶
NewTimeStore returns a TimeStore that uses a datastore for peristence.
Click to show internal directories.
Click to hide internal directories.