Documentation
¶
Overview ¶
Package submission preserves immutable manual uploads across CLI invocations.
Index ¶
- Constants
- type Acknowledgement
- type Destination
- func (target *Destination) Current(ctx context.Context, id string) (bool, error)
- func (target *Destination) Deliver(ctx context.Context, request ingestion.Request) (result ingestion.Receipt, failure error)
- func (target *Destination) SuppressInitialEmpty(ctx context.Context, request ingestion.Request) (bool, error)
- type Outbox
- func (box *Outbox) Acknowledge(request ingestion.Request, fingerprint, stateID, contextID string) error
- func (box *Outbox) Acknowledgement(request ingestion.Request) (Acknowledgement, error)
- func (box *Outbox) Close() error
- func (box *Outbox) Pending() ([]Pending, error)
- func (box *Outbox) Remove(id string) error
- func (box *Outbox) Save(pending Pending) error
- type Pending
- type SyncOptions
- type SyncResult
- type Target
Constants ¶
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 (*Destination) SuppressInitialEmpty ¶
type Outbox ¶
type Outbox struct {
// contains filtered or unexported fields
}
func (*Outbox) Acknowledge ¶
func (*Outbox) Acknowledgement ¶
func (box *Outbox) Acknowledgement(request ingestion.Request) (Acknowledgement, error)
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.