Documentation
¶
Index ¶
Constants ¶
View Source
const StoreFilename = "stargazers.json"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NotifyingStore ¶ added in v0.3.0
NotifyingStore is a Store that notifies a Notifier when stargazers are added or removed.
func NewNotifyingStore ¶ added in v0.3.0
func NewNotifyingStore(databaseDirectory string, notifiers Notifiers) (*NotifyingStore, error)
NewNotifyingStore creates a new NotifyingStore.
func (NotifyingStore) Add ¶ added in v0.3.0
Add adds new stargazers to a repository. Notifies the Notifier if there were any new stargazers.
type SlackNotifier ¶ added in v0.3.0
type SlackNotifier struct {
// WebHookURL is the URL to the Slack webhook
WebHookURL string
// MaximumUsers is the maximum number of users to notify about. Default is 5.
// If the number of stargazers is greater than this, SlackNotifier only notifies the number of users.
MaximumUsers int
}
SlackNotifier is a Notifier that posts added/removed stargazers to a Slack channel.
type SlogNotifier ¶ added in v0.3.0
type SlogNotifier struct{}
SlogNotifier is a Notifier that logs the added/removed stargazers to a slog.Logger stored in the context.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains all stars for all repositories
func (*Store) Add ¶
Add adds new stargazers to a repository. Returns the new stargazers and an error if there was a problem saving the store to disk.
Click to show internal directories.
Click to hide internal directories.