workers

package
v0.0.0-...-6a105b6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveWorker

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

func NewArchiveWorker

func NewArchiveWorker(session *gorethink.Session, table, subscribers, topic string, producer *nsq.Producer) *ArchiveWorker

func (*ArchiveWorker) HandleMessage

func (a *ArchiveWorker) HandleMessage(m *nsq.Message) error

type ExternalURL

type ExternalURL struct {
	URL string `gorethink:"url"`
}

ExternalURL is the scheme for when users register external urls that are to be called so that they can subscribe to events on the repo.

type MultiplexWorker

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

func NewMultiplexWorker

func NewMultiplexWorker(session *gorethink.Session, timeout time.Duration, logger *logrus.Logger) *MultiplexWorker

NewMultiplexWorker returns a nsq.Handler that will process messages for calling external webook urls with a specified timeout. It requires a session to rethinkdb so retreive the data for posting to the enternal urls.

func (*MultiplexWorker) Close

func (w *MultiplexWorker) Close() error

func (*MultiplexWorker) HandleMessage

func (w *MultiplexWorker) HandleMessage(m *nsq.Message) error

type Payload

type Payload struct {
	// ID is the id of the key within the database where the data lives
	ID string `json:"id"`
	// URL is the url of the client where the payload should be sent
	URL string `json:"url"`
	// Table is the name of the table to fetch the raw data from
	Table string `json:"table"`
}

Payload is the message body that is sent to the MultiplexWorker for sending a webhook payload to external urls

Jump to

Keyboard shortcuts

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