storage

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageSchemaVersion = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryRepo added in v0.12.0

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

HistoryRepo implements gollem.HistoryRepository using the storage service. It persists the latest history snapshot for a ticket, keyed by ticket ID. Save errors are handled via errutil but not returned to avoid interrupting agent execution.

func NewHistoryRepo added in v0.12.0

func NewHistoryRepo(svc *Service, ticketID types.TicketID) *HistoryRepo

NewHistoryRepo creates a new HistoryRepo for the given ticket.

func NewHistoryRepoFromContext added in v0.12.0

func NewHistoryRepoFromContext(_ context.Context, svc *Service, ticketID types.TicketID) *HistoryRepo

NewHistoryRepoFromContext creates a new HistoryRepo for the given ticket.

func (*HistoryRepo) Load added in v0.12.0

func (r *HistoryRepo) Load(ctx context.Context, _ string) (*gollem.History, error)

Load retrieves the latest history for the ticket. Returns nil History and nil error if not found.

func (*HistoryRepo) Save added in v0.12.0

func (r *HistoryRepo) Save(ctx context.Context, _ string, history *gollem.History) error

Save persists the history as the latest snapshot for the ticket. Errors are handled via errutil but not returned to avoid interrupting agent execution.

type Option

type Option func(*Service)

func WithPrefix

func WithPrefix(prefix string) Option

type Service

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

func New

func New(storageClient interfaces.StorageClient, opts ...Option) *Service

func (*Service) GetHistory

func (s *Service) GetHistory(ctx context.Context, ticketID types.TicketID, historyID types.HistoryID) (*gollem.History, error)

func (*Service) GetLatestHistory added in v0.12.0

func (s *Service) GetLatestHistory(ctx context.Context, ticketID types.TicketID) (*gollem.History, error)

GetLatestHistory retrieves the latest history snapshot for the given ticket. Returns nil History and nil error if the storage client is not configured.

func (*Service) PutHistory

func (s *Service) PutHistory(ctx context.Context, ticketID types.TicketID, historyID types.HistoryID, history *gollem.History) error

func (*Service) PutLatestHistory added in v0.12.0

func (s *Service) PutLatestHistory(ctx context.Context, ticketID types.TicketID, history *gollem.History) error

PutLatestHistory saves the history as the latest snapshot for the given ticket. The object at latest.json is overwritten on each call.

Jump to

Keyboard shortcuts

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