streamstore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package streamstore persists bounded, short-lived provider byte streams in private files without loading them into memory or SQLite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reference

type Reference struct {
	ID         string `json:"id"`
	Owner      string `json:"owner"`
	Purpose    string `json:"purpose"`
	RequestKey string `json:"request_key"`
	Digest     string `json:"digest"`
	Size       int64  `json:"size"`
	MediaType  string `json:"media_type"`
	ExpiresAt  int64  `json:"expires_at"`
}

type Store

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

func Open

func Open(stateDir string) (*Store, error)

func (*Store) Consume

func (s *Store) Consume(owner, id string) (*os.File, Reference, error)

func (*Store) Delete

func (s *Store) Delete(reference Reference) error

func (*Store) OpenOwned

func (s *Store) OpenOwned(owner, id string) (*os.File, Reference, error)

OpenOwned opens a verified stream for its owner without consuming it. The caller deletes the stream only after the complete response is delivered.

func (*Store) OpenStream

func (s *Store) OpenStream(reference Reference) (*os.File, error)

func (*Store) Put

func (s *Store) Put(owner, purpose, requestKey, mediaType string, source io.Reader, limit int64, expires time.Time) (Reference, error)

func (*Store) Retire

func (s *Store) Retire(reference Reference, retainUntil time.Time) error

Retire removes stream bytes while retaining enough metadata to replay the original upload request for the caller's idempotency window.

func (*Store) SweepExpired

func (s *Store) SweepExpired(now time.Time) (int, error)

func (*Store) Validate

func (s *Store) Validate(reference Reference) error

Jump to

Keyboard shortcuts

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