Versions in this module Expand all Collapse all v0 v0.13.0 Sep 29, 2026 Changes in this version + var ErrBusy = errors.New("transfer capacity unavailable") + var ErrClosed = errors.New("transfer manager closed") + var ErrConflict = errors.New("transfer conflicts with existing task") + var ErrExpired = errors.New("transfer start window expired") + var ErrInvalidState = errors.New("transfer state does not permit this operation") + var ErrNotFound = errors.New("transfer not found") + var ErrStoreLocked = errors.New("transfer metadata is already in use") + var ErrStoreUnusable = errors.New("transfer metadata cannot be persisted") + var ErrUnauthorized = errors.New("invalid transfer credential") + type Direction string + const Download + const Upload + type Journal struct + func OpenJournal(directory string) (_ *Journal, retErr error) + func (j *Journal) Close() error + func (j *Journal) Load(limit int) (_ []Record, retErr error) + func (j *Journal) Remove(id string) error + func (j *Journal) Save(record Record) (retErr error) + type Lease struct + func (l *Lease) BeginCommit() (context.Context, error) + func (l *Lease) Close() error + func (l *Lease) Complete() (Status, error) + func (l *Lease) ConfirmTemporary() error + func (l *Lease) Context() context.Context + func (l *Lease) Fail(cause error) (Status, error) + func (l *Lease) Progress(bytes int64) error + func (l *Lease) RejectCommit(cause error) (Status, error) + func (l *Lease) Spec() Spec + func (l *Lease) Temporary() (string, error) + func (l *Lease) Verify(bytes int64, digest string) error + type Limits struct + CommitTimeout time.Duration + MaxActive int + MaxFileBytes int64 + MaxPerTarget int + MaxReady int + MaxRecords int + Retention time.Duration + StartWindow time.Duration + TotalTimeout time.Duration + func DefaultLimits() Limits + func (l Limits) Validate() error + type Manager struct + func NewManager(ctx context.Context, store Store, limits Limits) (_ *Manager, retErr error) + func (m *Manager) Authenticate(id, token string) (Status, error) + func (m *Manager) Cancel(scope, id string) (Status, error) + func (m *Manager) CancelWithToken(id, token string) (Status, error) + func (m *Manager) Claim(ctx context.Context, id, token string, direction Direction) (*Lease, error) + func (m *Manager) Cleaned(id string) error + func (m *Manager) Close() error + func (m *Manager) Lookup(scope, id string) (Status, error) + func (m *Manager) Prepare(spec Spec, operationID string) (Prepared, error) + func (m *Manager) Record(id string) (Record, error) + func (m *Manager) Records() []Record + func (m *Manager) Retry(scope, requestID, requestDigest string) (Prepared, bool, error) + func (m *Manager) Shutdown(ctx context.Context) error + func (m *Manager) Warn(id, warning string) error + type Prepared struct + Status Status + Token string + type Record struct + Bytes int64 + CancelRequested bool + CleanupPending bool + CreatedAt time.Time + Error string + ID string + OperationID string + Resolution string + Resolved bool + SHA256 string + Spec Spec + StartBefore time.Time + State State + StatusExpiresAt time.Time + TempOwned bool + TempPath string + TokenDigest string + UpdatedAt time.Time + Version int + Warning string + func (r Record) Status() Status + type Spec struct + Direction Direction + NodeID string + Overwrite bool + RemotePath string + RequestDigest string + RequestID string + RequestedPath string + SHA256 string + Scope string + Size int64 + SourceModTime int64 + TargetID string + type State string + const Cancelled + const Committing + const Completed + const Expired + const Failed + const Ready + const Streamed + const Transferring + const Unknown + const Verifying + type Status struct + Bytes int64 + CancelRequested bool + CleanupPending bool + Direction Direction + Error string + ID string + NodeID string + OperationID string + RemotePath string + Resolved bool + SHA256 string + Size int64 + StartBefore time.Time + State State + StatusExpiresAt time.Time + TempOwned bool + UpdatedAt time.Time + Warning string + type Store interface + Close func() error + Load func(limit int) ([]Record, error) + Remove func(id string) error + Save func(Record) error