Documentation ¶
Overview ¶
Copyright 2021 CodeNotary, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 CodeNotary, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- 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) 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) SetOffset(off int64) error
- func (mf *MultiFileAppendable) Size() (int64, error)
- func (mf *MultiFileAppendable) Sync() error
- type 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 (opt *Options) WithReadOnly(readOnly bool) *Options
- func (opt *Options) WithSynced(synced bool) *Options
Constants ¶
const DefaultCompressionFormat = appendable.DefaultCompressionFormat
const DefaultCompressionLevel = appendable.DefaultCompressionLevel
const DefaultFileMode = os.FileMode(0755)
const DefaultFileSize = 1 << 26 // 64Mb
const DefaultMaxOpenedFiles = 10
Variables ¶
var ErrAlreadyClosed = errors.New("multi-appendable already closed")
var ErrIllegalArguments = errors.New("illegal arguments")
var ErrReadOnly = errors.New("cannot append when openned in read-only mode")
var ErrorPathIsNotADirectory = errors.New("path is not a directory")
Functions ¶
This section is empty.
Types ¶
type MultiFileAppendable ¶
type MultiFileAppendable struct {
// contains filtered or unexported fields
}
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) 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) SetOffset ¶
func (mf *MultiFileAppendable) SetOffset(off int64) error
func (*MultiFileAppendable) Size ¶
func (mf *MultiFileAppendable) Size() (int64, error)
func (*MultiFileAppendable) Sync ¶
func (mf *MultiFileAppendable) Sync() error
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() *Options