mongo

package
v0.0.0-...-e9fe98c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RetryAttempts sets the amount of default retries.
	RetryAttempts = 3

	// LockDuration sets how long an item needs to be locked for.
	LockDuration time.Duration = time.Minute * 10
)

Variables

This section is empty.

Functions

func ResultToQueueMessage

func ResultToQueueMessage(layer wrapper.DocumentResultLayer) (*message.QueueMessage, error)

ResultToQueueMessage converts a MongoDB result to a QueueMessage.

Types

type Provider

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

Provider implements the Provider interface.

func New

func New(ctx context.Context, user string, pass string, host string, db string, collection string, opts *mongo.ClientOptions) (*Provider, error)

New creates a new MongoDB (UpdateChecker) with a default client.

func NewWithClient

func NewWithClient(ctx context.Context, db string, collection string, client wrapper.Client) (*Provider, error)

NewWithClient creates a new MongoDB (UpdateChecker) with a provided ClientInterface client.

func (Provider) Close

func (m Provider) Close() error

Close the MongoDB client.

func (Provider) DeleteMessage

func (m Provider) DeleteMessage(ref *string) error

DeleteMessage deletes a Document from MongoDB.

func (Provider) GetNextMessage

func (m Provider) GetNextMessage() (*message.Message, error)

GetNextMessage gets the next message from MongoDB.

func (Provider) SendMessage

func (m Provider) SendMessage(msg *message.Message) error

SendMessage sends a message to MongoDB.

Jump to

Keyboard shortcuts

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