storage

package
v0.0.0-...-8b91daf Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDoesNotExist = errors.New("does not exist")

Functions

func NewDiskStorage

func NewDiskStorage(baseDir string) *diskStorage

NewDiskStorage initializes a new DiskStorage instance

func NewMemoryStorage

func NewMemoryStorage() *memoryStorage

func NewS3Storage

func NewS3Storage(client *s3.Client, bucketName string) *s3Storage

NewS3Storage initializes a new S3Storage instance

Types

type StreamWriter

type StreamWriter interface {
	io.Writer
	io.Closer
}

type System

type System interface {
	// WriteFile writes data to a file for a given timestamp and granularity (e.g., second, minute, hour)
	Write(ctx context.Context, key string, data []byte) error

	BeginStream(ctx context.Context, key string) StreamWriter

	// ReadFile reads data from a file for a given timestamp and granularity
	Read(ctx context.Context, key string) ([]byte, error)

	// DeleteFile deletes a file for a given timestamp and granularity
	Delete(ctx context.Context, key string) error

	GetKeysWithPrefix(ctx context.Context, prefix string) ([]string, error)
}

System defines the operations for interacting with the storage backend

Jump to

Keyboard shortcuts

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