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 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) 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(off int64) error
- func (aof *AppendableFile) Size() (int64, error)
- func (aof *AppendableFile) Sync() error
- type Options
- func (opts *Options) GetCompressionFormat() int
- func (opts *Options) GetCompressionLevel() int
- func (opts *Options) Valid() bool
- 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) WithReadOnly(readOnly bool) *Options
- func (opts *Options) WithSynced(synced bool) *Options
Constants ¶
const DefaultCompressionFormat = appendable.DefaultCompressionFormat
const DefaultCompressionLevel = appendable.DefaultCompressionLevel
const DefaultFileMode = os.FileMode(0644)
Variables ¶
var ErrAlreadyClosed = errors.New("single-file appendable already closed")
var ErrCorruptedMetadata = errors.New("corrupted metadata")
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 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) 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(off int64) error
func (*AppendableFile) Size ¶
func (aof *AppendableFile) Size() (int64, error)
func (*AppendableFile) Sync ¶
func (aof *AppendableFile) Sync() error
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() *Options