worker

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinUpdater

type CoinUpdater struct {
	// contains filtered or unexported fields
}

func NewCoinUpdater

func NewCoinUpdater(store *store.Store, log log.Logger, nE *notifications.Notifications, n *Notifier, p pusher, config CoinUpdaterConfig, cm *coinmanager.CoinManager) *CoinUpdater

func (*CoinUpdater) Run

func (c *CoinUpdater) Run()

func (*CoinUpdater) RunPopularPostUpdates

func (c *CoinUpdater) RunPopularPostUpdates()

func (*CoinUpdater) Stop

func (c *CoinUpdater) Stop()

type CoinUpdaterConfig

type CoinUpdaterConfig struct {
	LeaderboardUpdateFreqency int64
	LeaderboardPlacesLimit    int
}

type Config

type Config struct {
	EnableBugSnag bool
	EmbedlyToken  string

	ThumborHost string
	ThumborPort int

	Port int

	FCMServerKey string
	AMPKey       string

	NSQDAddress       string
	NSQLookupdAddress string
	SendGridAPIKey    string

	SlackWebhook         string
	GraphMonitorInterval int

	CoinUpdater CoinUpdaterConfig
}

Config provides the configuration required by the worker package.

func NewConfig

func NewConfig() Config

NewConfig returns a new instance of Config.

func (Config) Validate

func (c Config) Validate() error

Validate returns an error if the config is invalid.

type DatabaseMonitor

type DatabaseMonitor struct {
	// contains filtered or unexported fields
}

DatabaseMonitor sends selected metrics about data accessible from the database, i.e. number of users in the database.

func NewDatabaseMonitor

func NewDatabaseMonitor(ds *datastore.Store, s *statsd.Client, l log.Logger) *DatabaseMonitor

NewDatabaseMonitor returns a new instance of DatabaseMonitor.

func (*DatabaseMonitor) Start

func (dm *DatabaseMonitor) Start()

Start launches a go routine which will continiously update database metrics until Stop is called.

func (*DatabaseMonitor) Stop

func (dm *DatabaseMonitor) Stop()

Stop shuts down the go routine launched in Start.

type Notifier

type Notifier struct {
	FirebaseClient *fcm.Client
	Store          *store.Store
	SlackWebhook   string
	// contains filtered or unexported fields
}

Notifier manages the notifications to be send out to the user. It identifies each node with a list of possible devices.

func NewNotifier

func NewNotifier(s *store.Store, config *Config, l log.Logger) (*Notifier, error)

NewNotifier returns a NotificationWorker to issue notifications.

func (*Notifier) NotifyPush

func (n *Notifier) NotifyPush(eN *model.ExportedNotification) error

Notify is used to notify a given user (node) about a new card.

func (*Notifier) NotifySlack

func (n *Notifier) NotifySlack(channel, text string) error

func (*Notifier) NotifySlackAboutCard

func (n *Notifier) NotifySlackAboutCard(card, reply *model.Card, author *model.Author) error

type PendingPushMap

type PendingPushMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*PendingPushMap) IsPending

func (p *PendingPushMap) IsPending(id globalid.ID) bool

func (*PendingPushMap) SetPending

func (p *PendingPushMap) SetPending(id globalid.ID, to bool)

type ReengagementWorker

type ReengagementWorker struct {
	// contains filtered or unexported fields
}

SessionCleaner is responsible for invalidating sessions which have been expired.

func NewReengagementWorker

func NewReengagementWorker(s *store.Store, n *Notifier, l log.Logger) *ReengagementWorker

NewSessionCleaner returns a new instance of SessionCleaner.

func (*ReengagementWorker) Start

func (rw *ReengagementWorker) Start()

Start starts the worker. This method should be called as a goroutine, otherwise it will block any further execution.

func (*ReengagementWorker) Stop

func (rw *ReengagementWorker) Stop()

Stop shuts down the go routine launched in Start.

type SessionCleaner

type SessionCleaner struct {
	// contains filtered or unexported fields
}

SessionCleaner is responsible for invalidating sessions which have been expired.

func NewSessionCleaner

func NewSessionCleaner(s *store.Store, l log.Logger) *SessionCleaner

NewSessionCleaner returns a new instance of SessionCleaner.

func (*SessionCleaner) Start

func (sc *SessionCleaner) Start()

Start starts the worker. This method should be called as a goroutine, otherwise it will block any further execution.

func (*SessionCleaner) Stop

func (sc *SessionCleaner) Stop()

Stop shuts down the go routine launched in Start.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL