archiver

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileDateFormat = "2006/01/02"
)
View Source
const (
	S3DateFormat = "2006/01/02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseArchiver

type BaseArchiver[T any] struct {
	// contains filtered or unexported fields
}

func NewFileArchiver

func NewFileArchiver[T any](archiveDir, dataType string, bufSize int) (*BaseArchiver[T], error)

func NewS3Archiver

func NewS3Archiver[T any](client *s3.Client, bucket, path string, bufSize int) (*BaseArchiver[T], error)

func (*BaseArchiver[T]) Archive

func (t *BaseArchiver[T]) Archive(start time.Time, toAdd <-chan T, toDelete <-chan T) <-chan error

func (*BaseArchiver[T]) Retrieve

func (t *BaseArchiver[T]) Retrieve(from time.Time) (<-chan T, <-chan T, <-chan error, error)

type File

type File[T any] struct {
	Buf *bytes.Buffer

	Count int
	// contains filtered or unexported fields
}

func NewFile

func NewFile[T any](prefix string, part int) File[T]

func (*File[T]) Add

func (t *File[T]) Add(obj T) error

func (File[T]) Key

func (t File[T]) Key() string

type FileLoader

type FileLoader[T any] struct {
	// contains filtered or unexported fields
}

func (*FileLoader[T]) List

func (t *FileLoader[T]) List(start time.Time) (<-chan string, <-chan error)

func (*FileLoader[T]) Load

func (t *FileLoader[T]) Load(filename string) (io.ReadCloser, error)

type FileSaver

type FileSaver[T any] struct {
	// contains filtered or unexported fields
}

func (*FileSaver[T]) Save

func (t *FileSaver[T]) Save(start time.Time, uploads <-chan File[T]) <-chan error

type Loader

type Loader[T any] interface {
	List(start time.Time) (<-chan string, <-chan error)
	Load(path string) (io.ReadCloser, error)
}

type S3Loader

type S3Loader[T any] struct {
	// contains filtered or unexported fields
}

func (*S3Loader[T]) List

func (t *S3Loader[T]) List(start time.Time) (<-chan string, <-chan error)

func (*S3Loader[T]) Load

func (t *S3Loader[T]) Load(path string) (io.ReadCloser, error)

type S3Saver

type S3Saver[T any] struct {
	// contains filtered or unexported fields
}

func (*S3Saver[T]) Save

func (t *S3Saver[T]) Save(start time.Time, uploads <-chan File[T]) <-chan error

type Saver

type Saver[T any] interface {
	Save(start time.Time, in <-chan File[T]) <-chan error
}

Jump to

Keyboard shortcuts

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