warcwriterconfig

package
v3.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDateFormat = "2006-1-2"

Variables

This section is empty.

Functions

func NewDefaultNamer

func NewDefaultNamer(fromFileName, filePrefix, dir string) gowarc.WarcFileNameGenerator

func NewIdentityNamer

func NewIdentityNamer(fromFileName, filePrefix, dir string) gowarc.WarcFileNameGenerator

func NewNedlibNamer

func NewNedlibNamer(fromFileName, filePrefix, dir string) gowarc.WarcFileNameGenerator

func WithBufferTmpDir

func WithBufferTmpDir(tmpDir string) func(*WarcWriterOptions)

func WithCloseOutputFileHook

func WithCloseOutputFileHook(hook string) func(*WarcWriterOptions)

func WithCompress

func WithCompress(compress bool) func(*WarcWriterOptions)

func WithCompressionLevel

func WithCompressionLevel(level int) func(*WarcWriterOptions)

func WithConcurrentWriters

func WithConcurrentWriters(writers int) func(*WarcWriterOptions)

func WithDefaultTime

func WithDefaultTime(time string) func(*WarcWriterOptions)

func WithFilePrefix

func WithFilePrefix(prefix string) func(*WarcWriterOptions)

func WithFlush

func WithFlush(flush bool) func(*WarcWriterOptions)

func WithMaxFileSize

func WithMaxFileSize(size string) func(*WarcWriterOptions)

func WithOneToOneWriter

func WithOneToOneWriter(oneToOne bool) func(*WarcWriterOptions)

func WithOpenOutputFileHook

func WithOpenOutputFileHook(hook string) func(*WarcWriterOptions)

func WithOutDir

func WithOutDir(outDir string) func(*WarcWriterOptions)

func WithSubDirPattern

func WithSubDirPattern(pattern string) func(*WarcWriterOptions)

func WithWarcFileNameGenerator

func WithWarcFileNameGenerator(generator string) func(*WarcWriterOptions)

func WithWarcInfoFunc

func WithWarcInfoFunc(f func(recordBuilder gowarc.WarcRecordBuilder) error) func(*WarcWriterOptions)

func WithWarcVersion

func WithWarcVersion(version string) func(*WarcWriterOptions)

Types

type WarcWriterConfig

type WarcWriterConfig struct {
	FilePrefix            string
	DefaultTime           time.Time
	OutDir                string
	TmpDir                string
	Flush                 bool
	WarcVersion           *gowarc.WarcVersion
	WarcFileNameGenerator string
	SubDirPattern         string

	WarcInfoFunc func(recordBuilder gowarc.WarcRecordBuilder) error

	OneToOneWriter bool

	WarcFileWriterOptions []gowarc.WarcFileWriterOption
	// contains filtered or unexported fields
}

func New

func New(cmd string, options ...func(*WarcWriterOptions)) (*WarcWriterConfig, error)

func (*WarcWriterConfig) Close

func (w *WarcWriterConfig) Close() error

func (*WarcWriterConfig) GetWarcWriter

func (w *WarcWriterConfig) GetWarcWriter(fromFileName, warcDate string) (*gowarc.WarcFileWriter, error)

type WarcWriterOptions

type WarcWriterOptions struct {
	WarcVersion           string
	OutDir                string
	DefaultTime           string
	OpenOutputFileHook    string
	CloseOutputFileHook   string
	Compress              bool
	CompressionLevel      int
	ConcurrentWriters     int
	MaxFileSize           string
	FilePrefix            string
	SubDirPattern         string
	WarcFileNameGenerator string
	Flush                 bool
	OneToOneWriter        bool
	WarcInfoFunc          func(recordBuilder gowarc.WarcRecordBuilder) error
	TmpDir                string
}

Jump to

Keyboard shortcuts

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