queue

package
v0.0.0-...-ff8a812 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobKindFilesCopy    = "files.copy"
	JobKindFilesMove    = "files.move"
	JobKindFilesDelete  = "files.delete"
	JobKindSyncRun      = "sync.run"
	JobKindSyncTransfer = "sync.transfer"

	JobKindCleanOldEvents    = "clean.old_events"
	JobKindCleanStaleUpload  = "clean.stale_uploads"
	JobKindCleanPendingFile  = "clean.pending_files"
	JobKindRefreshFolderSize = "refresh.folder_sizes"
)
View Source
const QueueUploads = "uploads"

Variables

This section is empty.

Functions

func NewClient

func NewClient(pool *pgxpool.Pool, exec Executor, cfg config.QueueConfig, jobsCfg config.JobsConfig) (*river.Client[pgx.Tx], error)

Types

type CleanOldEventsArgs

type CleanOldEventsArgs struct {
	UserID    int64  `json:"userId"`
	Retention string `json:"retention"`
}

func (CleanOldEventsArgs) Kind

func (CleanOldEventsArgs) Kind() string

type CleanPendingFilesArgs

type CleanPendingFilesArgs struct {
	UserID int64 `json:"userId"`
}

func (CleanPendingFilesArgs) Kind

type CleanStaleUploadsArgs

type CleanStaleUploadsArgs struct {
	UserID    int64  `json:"userId"`
	Retention string `json:"retention"`
}

func (CleanStaleUploadsArgs) Kind

type Executor

type Executor interface {
	SyncRun(ctx context.Context, args SyncRunJobArgs, jobID int64) error
	SyncTransfer(ctx context.Context, args SyncTransferJobArgs, jobID int64) error
	CleanOldEventsForUser(ctx context.Context, args CleanOldEventsArgs) error
	CleanStaleUploadsForUser(ctx context.Context, args CleanStaleUploadsArgs) error
	CleanPendingFilesForUser(ctx context.Context, userID int64) error
	RefreshFolderSizesForUser(ctx context.Context, userID int64) error
}

type JobItem

type JobItem struct {
	ID              string `json:"id"`
	DestinationName string `json:"destinationName,omitempty"`
}

type RefreshFolderSizesArgs

type RefreshFolderSizesArgs struct {
	UserID int64 `json:"userId"`
}

func (RefreshFolderSizesArgs) Kind

type SyncFilters

type SyncFilters struct {
	Include          []string `json:"include,omitempty"`
	Exclude          []string `json:"exclude,omitempty"`
	MinSize          int64    `json:"minSize,omitempty"`
	MaxSize          int64    `json:"maxSize,omitempty"`
	ExcludeIfPresent []string `json:"excludeIfPresent,omitempty"`
}

type SyncOptions

type SyncOptions struct {
	PartSize  int64 `json:"partSize,omitempty"`
	Encrypted bool  `json:"encrypted,omitempty"`
	Sync      bool  `json:"sync,omitempty"`
}

type SyncRunJobArgs

type SyncRunJobArgs struct {
	UserID         int64             `json:"userId" river:"unique"`
	RunID          string            `json:"runId,omitempty"`
	Source         string            `json:"source"`
	DestinationDir string            `json:"destinationDir"`
	Headers        map[string]string `json:"headers,omitempty"`
	Proxy          string            `json:"proxy,omitempty"`
	Filters        SyncFilters       `json:"filters,omitempty"`
	Options        SyncOptions       `json:"options,omitempty"`
	PollInterval   int               `json:"pollInterval,omitempty"`
}

func (SyncRunJobArgs) Kind

func (SyncRunJobArgs) Kind() string

type SyncTransferJobArgs

type SyncTransferJobArgs struct {
	UserID             int64             `json:"userId" river:"unique"`
	RunID              string            `json:"runId"`
	Source             string            `json:"source"`
	SourcePath         string            `json:"sourcePath,omitempty"`
	DestinationPath    string            `json:"destinationPath,omitempty"`
	Name               string            `json:"name"`
	Size               int64             `json:"size,omitempty"`
	MimeType           string            `json:"mimeType,omitempty"`
	Hash               string            `json:"hash,omitempty"`
	ModifiedAtUnixNano int64             `json:"modifiedAtUnixNano,omitempty"`
	Headers            map[string]string `json:"headers,omitempty"`
	Proxy              string            `json:"proxy,omitempty"`
	PartSize           int64             `json:"partSize,omitempty"`
	Encrypted          bool              `json:"encrypted,omitempty"`
}

func (SyncTransferJobArgs) Kind

func (SyncTransferJobArgs) Kind() string

Jump to

Keyboard shortcuts

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