singleapp

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCompressionFormat = appendable.DefaultCompressionFormat
View Source
const DefaultCompressionLevel = appendable.DefaultCompressionLevel
View Source
const DefaultFileMode = os.FileMode(0644)
View Source
const DefaultReadBufferSize = 4096
View Source
const DefaultWriteBufferSize = 4096

Variables

View Source
var ErrAlreadyClosed = errors.New("singleapp: already closed")
View Source
var ErrBufferFull = errors.New("singleapp: buffer full")
View Source
var ErrCorruptedMetadata = errors.New("singleapp: corrupted metadata")
View Source
var ErrIllegalArguments = errors.New("singleapp: illegal arguments")
View Source
var ErrInvalidOptions = fmt.Errorf("%w: invalid options", ErrIllegalArguments)
View Source
var ErrNegativeOffset = errors.New("singleapp: negative offset")
View Source
var ErrReadOnly = errors.New("singleapp: read-only mode")
View Source
var ErrorPathIsNotADirectory = errors.New("singleapp: path is not a directory")

Functions

This section is empty.

Types

type AppendableFile

type AppendableFile struct {
	// contains filtered or unexported fields
}

func Open

func Open(fileName string, opts *Options) (*AppendableFile, error)

func (*AppendableFile) Append

func (aof *AppendableFile) Append(bs []byte) (off int64, n int, err error)

func (*AppendableFile) Close

func (aof *AppendableFile) Close() error

func (*AppendableFile) CompressionFormat

func (aof *AppendableFile) CompressionFormat() int

func (*AppendableFile) CompressionLevel

func (aof *AppendableFile) CompressionLevel() int

func (*AppendableFile) Copy added in v0.9.1

func (aof *AppendableFile) Copy(dstPath string) error

func (*AppendableFile) DiscardUpto added in v1.2.3

func (aof *AppendableFile) DiscardUpto(off int64) error

func (*AppendableFile) Flush

func (aof *AppendableFile) Flush() error

func (*AppendableFile) Metadata

func (aof *AppendableFile) Metadata() []byte

func (*AppendableFile) Offset

func (aof *AppendableFile) Offset() int64

func (*AppendableFile) ReadAt

func (aof *AppendableFile) ReadAt(bs []byte, off int64) (n int, err error)

func (*AppendableFile) SetOffset

func (aof *AppendableFile) SetOffset(newOffset int64) error

func (*AppendableFile) Size

func (aof *AppendableFile) Size() (int64, error)

func (*AppendableFile) SwitchToReadOnlyMode added in v1.3.2

func (aof *AppendableFile) SwitchToReadOnlyMode() error

func (*AppendableFile) Sync

func (aof *AppendableFile) Sync() error

type Options

type Options struct {
	// contains filtered or unexported fields
}

func DefaultOptions

func DefaultOptions() *Options

func (*Options) GetCompressionFormat added in v1.0.5

func (opts *Options) GetCompressionFormat() int

func (*Options) GetCompressionLevel added in v1.0.5

func (opts *Options) GetCompressionLevel() int

func (*Options) GetPreallocSize added in v1.5.0

func (opts *Options) GetPreallocSize() int

func (*Options) GetReadBufferSize added in v1.2.3

func (opts *Options) GetReadBufferSize() int

func (*Options) GetWriteBuffer added in v1.3.2

func (opts *Options) GetWriteBuffer() []byte

func (*Options) Validate added in v1.3.2

func (opts *Options) Validate() error

func (*Options) WithAutoSync added in v1.3.2

func (opts *Options) WithAutoSync(autoSync bool) *Options

func (*Options) WithCompresionLevel

func (opts *Options) WithCompresionLevel(compressionLevel int) *Options

func (*Options) WithCompressionFormat

func (opts *Options) WithCompressionFormat(compressionFormat int) *Options

func (*Options) WithCreateIfNotExists added in v1.5.0

func (opts *Options) WithCreateIfNotExists(createIfNotExists bool) *Options

func (*Options) WithFileMode

func (opts *Options) WithFileMode(fileMode os.FileMode) *Options

func (*Options) WithMetadata

func (opts *Options) WithMetadata(metadata []byte) *Options

func (*Options) WithPreallocSize added in v1.5.0

func (opts *Options) WithPreallocSize(preallocSize int) *Options

func (*Options) WithReadBufferSize added in v1.2.3

func (opts *Options) WithReadBufferSize(size int) *Options

func (*Options) WithReadOnly

func (opts *Options) WithReadOnly(readOnly bool) *Options

func (*Options) WithRetryableSync added in v1.3.2

func (opts *Options) WithRetryableSync(retryableSync bool) *Options

func (*Options) WithWriteBuffer added in v1.3.2

func (opts *Options) WithWriteBuffer(b []byte) *Options

Jump to

Keyboard shortcuts

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