Documentation ¶
Index ¶
- Constants
- Variables
- type DefaultMultiFileAppendableHooks
- func (d *DefaultMultiFileAppendableHooks) OpenAppendable(options *singleapp.Options, appname string, needsWriteAccess bool) (appendable.Appendable, error)
- func (d *DefaultMultiFileAppendableHooks) OpenInitialAppendable(opts *Options, singleAppOpts *singleapp.Options) (app appendable.Appendable, appID int64, err error)
- type MultiFileAppendable
- func (mf *MultiFileAppendable) Append(bs []byte) (off int64, n int, err error)
- func (mf *MultiFileAppendable) Close() error
- func (mf *MultiFileAppendable) CompressionFormat() int
- func (mf *MultiFileAppendable) CompressionLevel() int
- func (mf *MultiFileAppendable) Copy(dstPath string) error
- func (mf *MultiFileAppendable) CurrApp() (appendable.Appendable, int64)
- func (mf *MultiFileAppendable) DiscardUpto(off int64) error
- func (mf *MultiFileAppendable) Flush() error
- func (mf *MultiFileAppendable) Metadata() []byte
- func (mf *MultiFileAppendable) Offset() int64
- func (mf *MultiFileAppendable) ReadAt(bs []byte, off int64) (int, error)
- func (mf *MultiFileAppendable) ReplaceCachedChunk(appID int64, app appendable.Appendable) (appendable.Appendable, error)
- func (mf *MultiFileAppendable) SetOffset(off int64) error
- func (mf *MultiFileAppendable) Size() (int64, error)
- func (mf *MultiFileAppendable) SwitchToReadOnlyMode() error
- func (mf *MultiFileAppendable) Sync() error
- type MultiFileAppendableHooks
- type Options
- func (opt *Options) GetFileExt() string
- func (opt *Options) GetFileMode() os.FileMode
- func (opts *Options) GetPrealloc() bool
- func (opts *Options) GetReadBufferSize() int
- func (opts *Options) GetWriteBufferSize() int
- func (opts *Options) Validate() error
- func (opt *Options) WithAutoSync(autoSync bool) *Options
- func (opt *Options) WithCompresionLevel(compressionLevel int) *Options
- func (opt *Options) WithCompressionFormat(compressionFormat int) *Options
- func (opt *Options) WithFileExt(fileExt string) *Options
- func (opt *Options) WithFileMode(fileMode os.FileMode) *Options
- func (opt *Options) WithFileSize(fileSize int) *Options
- func (opt *Options) WithMaxOpenedFiles(maxOpenedFiles int) *Options
- func (opt *Options) WithMetadata(metadata []byte) *Options
- func (opts *Options) WithPrealloc(prealloc bool) *Options
- func (opts *Options) WithReadBufferSize(size int) *Options
- func (opt *Options) WithReadOnly(readOnly bool) *Options
- func (opt *Options) WithRetryableSync(retryableSync bool) *Options
- func (opts *Options) WithWriteBufferSize(size int) *Options
Constants ¶
View Source
const DefaultCompressionFormat = appendable.DefaultCompressionFormat
View Source
const DefaultCompressionLevel = appendable.DefaultCompressionLevel
View Source
const DefaultFileMode = os.FileMode(0755)
View Source
const DefaultFileSize = 1 << 26 // 64Mb
View Source
const DefaultMaxOpenedFiles = 10
View Source
const DefaultReadBufferSize = 4096
View Source
const DefaultWriteBufferSize = 4096
Variables ¶
View Source
var ErrAlreadyClosed = errors.New("multiapp: already closed")
View Source
var ErrIllegalArguments = errors.New("multiapp: illegal arguments")
View Source
var ErrInvalidOptions = fmt.Errorf("%w: invalid options", ErrIllegalArguments)
View Source
var ErrReadOnly = errors.New("multiapp: read-only mode")
View Source
var ErrorPathIsNotADirectory = errors.New("multiapp: path is not a directory")
Functions ¶
This section is empty.
Types ¶
type DefaultMultiFileAppendableHooks ¶ added in v1.0.5
type DefaultMultiFileAppendableHooks struct {
// contains filtered or unexported fields
}
func (*DefaultMultiFileAppendableHooks) OpenAppendable ¶ added in v1.0.5
func (d *DefaultMultiFileAppendableHooks) OpenAppendable(options *singleapp.Options, appname string, needsWriteAccess bool) (appendable.Appendable, error)
func (*DefaultMultiFileAppendableHooks) OpenInitialAppendable ¶ added in v1.0.5
func (d *DefaultMultiFileAppendableHooks) OpenInitialAppendable(opts *Options, singleAppOpts *singleapp.Options) (app appendable.Appendable, appID int64, err error)
type MultiFileAppendable ¶
type MultiFileAppendable struct {
// contains filtered or unexported fields
}
func OpenWithHooks ¶ added in v1.0.5
func OpenWithHooks(path string, hooks MultiFileAppendableHooks, opts *Options) (*MultiFileAppendable, error)
func (*MultiFileAppendable) Append ¶
func (mf *MultiFileAppendable) Append(bs []byte) (off int64, n int, err error)
func (*MultiFileAppendable) Close ¶
func (mf *MultiFileAppendable) Close() error
func (*MultiFileAppendable) CompressionFormat ¶
func (mf *MultiFileAppendable) CompressionFormat() int
func (*MultiFileAppendable) CompressionLevel ¶
func (mf *MultiFileAppendable) CompressionLevel() int
func (*MultiFileAppendable) Copy ¶ added in v0.9.1
func (mf *MultiFileAppendable) Copy(dstPath string) error
func (*MultiFileAppendable) CurrApp ¶ added in v1.0.5
func (mf *MultiFileAppendable) CurrApp() (appendable.Appendable, int64)
func (*MultiFileAppendable) DiscardUpto ¶ added in v1.2.3
func (mf *MultiFileAppendable) DiscardUpto(off int64) error
func (*MultiFileAppendable) Flush ¶
func (mf *MultiFileAppendable) Flush() error
func (*MultiFileAppendable) Metadata ¶
func (mf *MultiFileAppendable) Metadata() []byte
func (*MultiFileAppendable) Offset ¶
func (mf *MultiFileAppendable) Offset() int64
func (*MultiFileAppendable) ReadAt ¶
func (mf *MultiFileAppendable) ReadAt(bs []byte, off int64) (int, error)
func (*MultiFileAppendable) ReplaceCachedChunk ¶ added in v1.0.5
func (mf *MultiFileAppendable) ReplaceCachedChunk(appID int64, app appendable.Appendable) (appendable.Appendable, error)
func (*MultiFileAppendable) SetOffset ¶
func (mf *MultiFileAppendable) SetOffset(off int64) error
func (*MultiFileAppendable) Size ¶
func (mf *MultiFileAppendable) Size() (int64, error)
func (*MultiFileAppendable) SwitchToReadOnlyMode ¶ added in v1.3.2
func (mf *MultiFileAppendable) SwitchToReadOnlyMode() error
func (*MultiFileAppendable) Sync ¶
func (mf *MultiFileAppendable) Sync() error
type MultiFileAppendableHooks ¶ added in v1.0.5
type MultiFileAppendableHooks interface { // Hook to open underlying appendable. // If needsWriteAccess is set to true, this appendable must be a single file appendable OpenAppendable(options *singleapp.Options, appname string, needsWriteAccess bool) (appendable.Appendable, error) // Hook to open the last underlying appendable that's available OpenInitialAppendable(opts *Options, singleAppOpts *singleapp.Options) (app appendable.Appendable, appID int64, err error) }
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() *Options
func (*Options) GetFileExt ¶ added in v1.0.5
func (*Options) GetFileMode ¶ added in v1.0.5
func (*Options) GetPrealloc ¶ added in v1.5.0
func (*Options) GetReadBufferSize ¶ added in v1.2.3
func (*Options) GetWriteBufferSize ¶ added in v1.2.3
func (*Options) WithAutoSync ¶ added in v1.3.2
func (*Options) WithCompresionLevel ¶
func (*Options) WithCompressionFormat ¶
func (*Options) WithFileExt ¶
func (*Options) WithFileSize ¶
func (*Options) WithMaxOpenedFiles ¶
func (*Options) WithMetadata ¶
func (*Options) WithPrealloc ¶ added in v1.5.0
func (*Options) WithReadBufferSize ¶ added in v1.2.3
func (*Options) WithReadOnly ¶
func (*Options) WithRetryableSync ¶ added in v1.3.2
func (*Options) WithWriteBufferSize ¶ added in v1.2.3
Click to show internal directories.
Click to hide internal directories.