saver

package
v0.0.0-...-4c7982d Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalFileSaver

type LocalFileSaver struct {
	// StoragePath is the main folder to save into
	StoragePath  string
	OpenFileFunc OpenFileFunc
}

LocalFileSaver saves file on local disk

func NewLocalFileSaver

func NewLocalFileSaver(storagePath string) (*LocalFileSaver, error)

NewLocalFileSaver creates LocalFileSaver instance

func (*LocalFileSaver) HealthyFunc

func (fs *LocalFileSaver) HealthyFunc(sizeInMb uint64) func() error

HealthyFunc returns func for health check

func (LocalFileSaver) Save

func (fs LocalFileSaver) Save(name string, reader io.Reader) error

Save saves file to disk

type OpenFileFunc

type OpenFileFunc func(fileName string) (WriterCloser, error)

OpenFileFunc declares function to open file by name and return Writer

type WriterCloser

type WriterCloser interface {
	io.Writer
	Close() error
}

WriterCloser keeps Writer interface and close function

Jump to

Keyboard shortcuts

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