sync

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const QueueStoreKey = "TextileSyncTaskQueue"

Variables

This section is empty.

Functions

func New

func New(
	st store.Store,
	model model.Model,
	kc keychain.Keychain,
	hubAuth hub.HubAuth,
	hb *bucketsClient.Client,
	ht *threadsClient.Client,
	netc *nc.Client,
	cfg config.Config,
	getMirrorBucket GetMirrorBucketFn,
	getBucket GetBucketFn,
	getBucketCtx GetBucketCtxFn,
) *synchronizer

Creates a new Synchronizer

Types

type EventNotifier added in v0.0.23

type EventNotifier interface {
	SendFileEvent(event events.FileEvent)
}

type GetBucketCtxFn

type GetBucketCtxFn func(ctx context.Context, sDbID string, bucketSlug string, ishub bool, enckey []byte) (context.Context, *thread.ID, error)

type GetBucketFn

type GetBucketFn func(ctx context.Context, slug string) (bucket.BucketInterface, error)

type GetMirrorBucketFn

type GetMirrorBucketFn func(ctx context.Context, slug string) (bucket.BucketInterface, error)

type Synchronizer

type Synchronizer interface {
	NotifyItemAdded(bucket, path string)
	NotifyItemRemoved(bucket, path string)
	NotifyBucketCreated(bucket string, enckey []byte)
	NotifyBucketBackupOn(bucket string)
	NotifyBucketBackupOff(bucket string)
	Start(ctx context.Context)
	RestoreQueue() error
	Shutdown()
	String() string
	AttachNotifier(EventNotifier)
}

type Task

type Task struct {
	ID             string    `json:"id"`
	State          taskState `json:"state"`
	Type           taskType  `json:"type"`
	Args           []string  `json:"args"`
	Parallelizable bool      `json:"parallelizable"`

	// Set to -1 for infinite retries
	MaxRetries int `json:"maxRetries"`
	Retries    int `json:"retries"`
}

Jump to

Keyboard shortcuts

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