singleapp

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

Variables

View Source
var ErrAlreadyClosed = errors.New("single-file appendable already closed")
View Source
var ErrCorruptedMetadata = errors.New("corrupted metadata")
View Source
var ErrIllegalArguments = errors.New("illegal arguments")
View Source
var ErrReadOnly = errors.New("cannot append when openned in read-only mode")
View Source
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 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) 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

func (*Options) WithCompresionLevel

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

func (*Options) WithCompressionFormat

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

func (*Options) WithFileMode

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

func (*Options) WithMetadata

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

func (*Options) WithReadOnly

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

func (*Options) WithSynced

func (opts *Options) WithSynced(synced bool) *Options

Jump to

Keyboard shortcuts

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