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

This section is empty.

Types

type Provider

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

    Provider implements the Provider interface.

    func New

    func New(ctx context.Context, projectID string, rootDocPath string) (*Provider, error)

      New creates a new Sync (UpdateSyncChecker) with a default client using Firestore.

      func NewWithClient

      func NewWithClient(ctx context.Context, projectID string, rootDocPath string, client fsClient.ClientInterface) (*Provider, error)

        NewWithClient creates a new Sync (UpdateSyncChecker) with a provided ClientInterface client. Note: Use this one for the tests with a mock ClientInterface.

        func (Provider) Close

        func (fs Provider) Close() error

          Close the Firestore client.

          func (Provider) DeleteMessage

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

            DeleteMessage deletes a Document from Firestore.

            func (Provider) GetNextMessage

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

              GetNextMessage gets the next message from Firestore.

              This uses Firestore transactions to update the lock time and available retries for an item.

              func (Provider) SendMessage

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

                SendMessage sends a message to Firestore.

                Source Files