storage

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeStore

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

func NewCompositeStore

func NewCompositeStore(inner MessageStore, mode string, stages []string) *CompositeStore

func (*CompositeStore) Delete

func (c *CompositeStore) Delete(id string) error

func (*CompositeStore) Get

func (c *CompositeStore) Get(id string) (*MessageRecord, error)

func (*CompositeStore) GetStage

func (c *CompositeStore) GetStage(id, stage string) (*MessageRecord, error)

func (*CompositeStore) Mode

func (c *CompositeStore) Mode() string

func (*CompositeStore) Prune

func (c *CompositeStore) Prune(before time.Time, channel string) (int, error)

func (*CompositeStore) Query

func (c *CompositeStore) Query(opts QueryOpts) ([]*MessageRecord, error)

func (*CompositeStore) Save

func (c *CompositeStore) Save(record *MessageRecord) error

func (*CompositeStore) ShouldStore

func (c *CompositeStore) ShouldStore(stage string) bool

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Delete

func (m *MemoryStore) Delete(id string) error

func (*MemoryStore) Get

func (m *MemoryStore) Get(id string) (*MessageRecord, error)

func (*MemoryStore) GetStage

func (m *MemoryStore) GetStage(id, stage string) (*MessageRecord, error)

func (*MemoryStore) Prune

func (m *MemoryStore) Prune(before time.Time, channel string) (int, error)

func (*MemoryStore) Query

func (m *MemoryStore) Query(opts QueryOpts) ([]*MessageRecord, error)

func (*MemoryStore) Save

func (m *MemoryStore) Save(record *MessageRecord) error

type MessageRecord

type MessageRecord struct {
	ID            string
	CorrelationID string
	ChannelID     string
	Stage         string
	Content       []byte
	Status        string
	Timestamp     time.Time
	DurationMs    int64 `json:"DurationMs,omitempty"`
	Metadata      map[string]any
}

type MessageStore

type MessageStore interface {
	Save(record *MessageRecord) error
	Get(id string) (*MessageRecord, error)
	GetStage(id, stage string) (*MessageRecord, error)
	Query(opts QueryOpts) ([]*MessageRecord, error)
	Delete(id string) error
	Prune(before time.Time, channel string) (int, error)
}

func NewMessageStore

func NewMessageStore(cfg *config.MessageStorageConfig) (MessageStore, error)

type PostgresStore

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

func NewPostgresStore

func NewPostgresStore(cfg *config.StoragePostgresConfig) (*PostgresStore, error)

func (*PostgresStore) Close

func (p *PostgresStore) Close() error

func (*PostgresStore) Delete

func (p *PostgresStore) Delete(id string) error

func (*PostgresStore) Get

func (p *PostgresStore) Get(id string) (*MessageRecord, error)

func (*PostgresStore) GetStage

func (p *PostgresStore) GetStage(id, stage string) (*MessageRecord, error)

func (*PostgresStore) Prune

func (p *PostgresStore) Prune(before time.Time, channel string) (int, error)

func (*PostgresStore) Query

func (p *PostgresStore) Query(opts QueryOpts) ([]*MessageRecord, error)

func (*PostgresStore) Save

func (p *PostgresStore) Save(record *MessageRecord) error

type QueryOpts

type QueryOpts struct {
	ChannelID      string
	Status         string
	Stage          string
	Since          time.Time
	Before         time.Time
	Limit          int
	Offset         int
	ExcludeContent bool
}

type S3Store

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

func NewS3Store

func NewS3Store(cfg *config.StorageS3Config) (*S3Store, error)

func (*S3Store) Close

func (s *S3Store) Close() error

func (*S3Store) Delete

func (s *S3Store) Delete(id string) error

func (*S3Store) Get

func (s *S3Store) Get(id string) (*MessageRecord, error)

func (*S3Store) GetStage

func (s *S3Store) GetStage(id, stage string) (*MessageRecord, error)

func (*S3Store) Prune

func (s *S3Store) Prune(before time.Time, channel string) (int, error)

func (*S3Store) Query

func (s *S3Store) Query(opts QueryOpts) ([]*MessageRecord, error)

func (*S3Store) Save

func (s *S3Store) Save(record *MessageRecord) error

Jump to

Keyboard shortcuts

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