writerfactory

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WriterFactory

type WriterFactory func(path string) (wc io.WriteCloser, err error)

WriterFactory should yield a new WriteCloser under the given path.

func GetLocalWriterFactory

func GetLocalWriterFactory(basePath string) WriterFactory

GetLocalWriterFactory returns a writer factory which creates local files in the basePath. If basePath == "" it defaults to current working dir ("./")

func GetMemoryWriterFactory

func GetMemoryWriterFactory() (map[string]*bytes.Buffer, WriterFactory)

GetMemoryWriterFactory returns a writer factory which is backed by RAM

func WithGzip

func WithGzip(wf WriterFactory) WriterFactory

WrapWFWithGzip adds gzip compresison to the writers that is returned by the underlying WriterFactory

func WrapWFWithPrefix

func WrapWFWithPrefix(wf WriterFactory, prefix string) WriterFactory

WrapWFWithPrefix adds a path prefix to all writes conducted by the writerfactory

func WrapWFWithSuffix added in v2.1.5

func WrapWFWithSuffix(wf WriterFactory, suffix string) WriterFactory

WrapWFWithSuffix adds a path suffix to all writes conducted by the writerfactory

func (WriterFactory) WithGzip

func (wf WriterFactory) WithGzip() WriterFactory

WithGzip adds gzip compresison to the writers that is returned by the underlying WriterFactory

func (WriterFactory) WithPrefix

func (wf WriterFactory) WithPrefix(prefix string) WriterFactory

WithPrefix adds a path prefix to all writes conducted by the writerfactory

func (WriterFactory) WithSuffix added in v2.1.5

func (wf WriterFactory) WithSuffix(suffix string) WriterFactory

WithSuffix adds a Suffix to all writes conducted by the writerfactory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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