resumer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locator

type Locator struct {
	Host     string
	Port     int
	FileName string
}

Locator identifies which server owns the live response recording for a conversation.

func DecodeLocator

func DecodeLocator(raw string) (Locator, bool)

func (Locator) Address

func (l Locator) Address() string

func (Locator) Encode

func (l Locator) Encode() string

func (Locator) MatchesAddress

func (l Locator) MatchesAddress(address string) bool

type LocatorStore

type LocatorStore interface {
	Available() bool
	Get(ctx context.Context, conversationID string) (*Locator, error)
	Upsert(ctx context.Context, conversationID string, locator Locator, ttl time.Duration) error
	Remove(ctx context.Context, conversationID string) error
	Exists(ctx context.Context, conversationID string) (bool, error)
}

LocatorStore stores and resolves response recorder ownership across service instances.

func NewLocatorStore

func NewLocatorStore(ctx context.Context, cfg *config.Config) (LocatorStore, error)

type Recorder

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

Recorder writes response tokens to the active recording.

func (*Recorder) Complete

func (r *Recorder) Complete() error

func (*Recorder) Record

func (r *Recorder) Record(token string) error

type Store

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

Store is the response recorder backend implementation backed by local temp files.

func NewTempFileStore

func NewTempFileStore(tempDir string, retention time.Duration, locatorStore LocatorStore) *Store

func (*Store) CancelStream

func (s *Store) CancelStream(_ context.Context, conversationID string) (<-chan struct{}, error)

func (*Store) Check

func (s *Store) Check(ctx context.Context, conversationIDs []string) ([]string, error)

func (*Store) HasResponseInProgress

func (s *Store) HasResponseInProgress(_ context.Context, conversationID string) (bool, error)

func (*Store) RecorderWithAddress

func (s *Store) RecorderWithAddress(ctx context.Context, conversationID string, advertisedAddress string) (*Recorder, error)

func (*Store) ReplayWithAddress

func (s *Store) ReplayWithAddress(ctx context.Context, conversationID string, advertisedAddress string) (<-chan string, string, error)

func (*Store) RequestCancelWithAddress

func (s *Store) RequestCancelWithAddress(ctx context.Context, conversationID string, advertisedAddress string) (string, error)

Jump to

Keyboard shortcuts

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