Documentation ¶
Index ¶
- Constants
- Variables
- type AppendableFile
- func (aof *AppendableFile) Append(bs []byte) (off int64, n int, err error)
- func (aof *AppendableFile) Close() error
- func (aof *AppendableFile) CompressionFormat() int
- func (aof *AppendableFile) CompressionLevel() int
- func (aof *AppendableFile) Copy(dstPath string) error
- func (aof *AppendableFile) DiscardUpto(off int64) error
- func (aof *AppendableFile) Flush() error
- func (aof *AppendableFile) Metadata() []byte
- func (aof *AppendableFile) Offset() int64
- func (aof *AppendableFile) ReadAt(bs []byte, off int64) (n int, err error)
- func (aof *AppendableFile) SetOffset(newOffset int64) error
- func (aof *AppendableFile) Size() (int64, error)
- func (aof *AppendableFile) SwitchToReadOnlyMode() error
- func (aof *AppendableFile) Sync() error
- type Options
- func (opts *Options) GetCompressionFormat() int
- func (opts *Options) GetCompressionLevel() int
- func (opts *Options) GetReadBufferSize() int
- func (opts *Options) GetWriteBuffer() []byte
- func (opts *Options) Validate() error
- func (opts *Options) WithAutoSync(autoSync bool) *Options
- func (opts *Options) WithCompresionLevel(compressionLevel int) *Options
- func (opts *Options) WithCompressionFormat(compressionFormat int) *Options
- func (opts *Options) WithFileMode(fileMode os.FileMode) *Options
- func (opts *Options) WithMetadata(metadata []byte) *Options
- func (opts *Options) WithReadBufferSize(size int) *Options
- func (opts *Options) WithReadOnly(readOnly bool) *Options
- func (opts *Options) WithRetryableSync(retryableSync bool) *Options
- func (opts *Options) WithWriteBuffer(b []byte) *Options
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 (*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 (*Options) GetCompressionLevel ¶ added in v1.0.5
func (*Options) GetReadBufferSize ¶ added in v1.2.3
func (*Options) GetWriteBuffer ¶ added in v1.3.2
func (*Options) WithAutoSync ¶ added in v1.3.2
func (*Options) WithCompresionLevel ¶
func (*Options) WithCompressionFormat ¶
func (*Options) WithMetadata ¶
func (*Options) WithReadBufferSize ¶ added in v1.2.3
func (*Options) WithReadOnly ¶
func (*Options) WithRetryableSync ¶ added in v1.3.2
func (*Options) WithWriteBuffer ¶ added in v1.3.2
Click to show internal directories.
Click to hide internal directories.