submission

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package submission preserves immutable manual uploads across CLI invocations.

Index

Constants

View Source
const AcknowledgementTTL = 24 * time.Hour

AcknowledgementTTL bounds how long any producer, manual sync or hooks, may trust an acknowledgement before uploading again.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acknowledgement

type Acknowledgement struct {
	Fingerprint string    `json:"fingerprint"`
	StateID     string    `json:"stateId"`
	ContextID   string    `json:"contextId"`
	At          time.Time `json:"at"`
}

Acknowledgement permits upload suppression only while its server context remains current. Fingerprints are supplied by the collector composition.

type Destination

type Destination struct {
	Target          Target
	Endpoint, Token string

	Progress func(ingestion.Job)
	// contains filtered or unexported fields
}

func Resolve

func Resolve(ctx context.Context, endpoint, token string) (*Destination, error)

func (*Destination) Current

func (target *Destination) Current(ctx context.Context, id string) (bool, error)

func (*Destination) Deliver

func (target *Destination) Deliver(ctx context.Context, request ingestion.Request) (result ingestion.Receipt, failure error)

func (*Destination) SuppressInitialEmpty

func (target *Destination) SuppressInitialEmpty(ctx context.Context, request ingestion.Request) (bool, error)

type Outbox

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

func Open

func Open(ctx context.Context, root, route string) (*Outbox, error)

func (*Outbox) Acknowledge

func (box *Outbox) Acknowledge(request ingestion.Request, fingerprint, stateID, contextID string) error

func (*Outbox) Acknowledgement

func (box *Outbox) Acknowledgement(request ingestion.Request) (Acknowledgement, error)

func (*Outbox) Close

func (box *Outbox) Close() error

func (*Outbox) Pending

func (box *Outbox) Pending() ([]Pending, error)

func (*Outbox) Remove

func (box *Outbox) Remove(id string) error

func (*Outbox) Save

func (box *Outbox) Save(pending Pending) error

type Pending

type Pending struct {
	Request ingestion.Request `json:"request"`
	StateID string            `json:"stateId,omitempty"`
}

type SyncOptions added in v0.2.1

type SyncOptions struct {
	StateDir, Server, Token string
	Fresh                   *ingestion.Request
	// Fingerprint identifies content plus the metadata that must still upload.
	Fingerprint func(ingestion.Request) string
	Progress    func(string)
}

SyncOptions describes one manual sync of a credential's route. Fresh is the new collection, or nil for an explicit retry or failed collection.

type SyncResult added in v0.2.1

type SyncResult struct {
	Uploaded, Unchanged int
	Failures            []error
	// Empty means no retained or fresh submission was eligible for upload.
	Empty bool
}

SyncResult reports completed work and per-submission failures that left immutable payloads retained for a later retry.

func Sync added in v0.2.1

func Sync(ctx context.Context, options SyncOptions) (SyncResult, error)

Sync persists the fresh collection before contacting the server, pins retained payloads to the verified destination, suppresses uploads whose acknowledged context is current, and republishes a fresh collection when a reused payload commits without becoming the stream head.

type Target

type Target struct{ Destination, Identity, SourceID string }

Jump to

Keyboard shortcuts

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