Documentation
¶
Overview ¶
Package storage provides a wrapper around omnistorage backends.
Index ¶
- type Storage
- func (s *Storage) Backend() omnistorage.Backend
- func (s *Storage) Close() error
- func (s *Storage) Delete(ctx context.Context, filePath string) error
- func (s *Storage) Exists(ctx context.Context, filePath string) (bool, error)
- func (s *Storage) Folder() string
- func (s *Storage) List(ctx context.Context, prefix string) ([]string, error)
- func (s *Storage) ListBySource(ctx context.Context, source string) ([]string, error)
- func (s *Storage) ListConversations(ctx context.Context) ([]string, error)
- func (s *Storage) Read(ctx context.Context, filePath string) ([]byte, error)
- func (s *Storage) Save(ctx context.Context, filePath string, content []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage wraps an omnistorage.Backend with ChatHub-specific operations.
func New ¶
func New(backend omnistorage.Backend, folder string) *Storage
New creates a new Storage instance.
func NewFromConfig ¶
NewFromConfig creates a Storage from backend name and config.
func (*Storage) Backend ¶
func (s *Storage) Backend() omnistorage.Backend
Backend returns the underlying omnistorage.Backend.
func (*Storage) ListBySource ¶
ListBySource lists conversations from a specific source.
func (*Storage) ListConversations ¶
ListConversations lists all conversation files in the storage folder.
Click to show internal directories.
Click to hide internal directories.