firestore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Slug        string    `firestore:"slug"`
	Kind        string    `firestore:"kind"`
	Payload     []byte    `firestore:"payload,omitempty"`
	When        time.Time `firestore:"run_at"`
	Version     int64     `firestore:"version"`
	Retry       int       `firestore:"retry,omitempty"`
	Result      string    `firestore:"result,omitempty"`
	LockedUntil time.Time `firestore:"locked_until"`
}

func (*Entry) IsUnlocked

func (e *Entry) IsUnlocked(t time.Time) bool

func (*Entry) Lock

func (e *Entry) Lock(d time.Duration)

func (*Entry) Unlock

func (e *Entry) Unlock()

type Store

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

Store is a firestore task store.

func New

func New(firestoreClient *gfs.Client, options ...StoreOption) *Store

func (*Store) Clear

func (s *Store) Clear(ctx context.Context) error

func (*Store) Create

func (s *Store) Create(ctx context.Context, task *scheduler.StoreTask) error

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, slug string) error

func (*Store) Get

func (s *Store) Get(ctx context.Context, slug string) (*scheduler.StoreTask, error)

func (*Store) GetSlugs

func (s *Store) GetSlugs(ctx context.Context) ([]string, error)

func (*Store) Lock

func (s *Store) Lock(ctx context.Context, task *scheduler.StoreTask) (*scheduler.StoreTask, error)

func (*Store) NextRun

func (s *Store) NextRun(ctx context.Context) (*scheduler.StoreTask, error)

func (*Store) Reschedule

func (s *Store) Reschedule(ctx context.Context, task *scheduler.StoreTask) error

type StoreOption

type StoreOption func(*Store)

func CollectionPathOption

func CollectionPathOption(collectionPath string) StoreOption

Jump to

Keyboard shortcuts

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