multiapp

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 15 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.

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(0755)
View Source
const DefaultFileSize = 1 << 26 // 64Mb
View Source
const DefaultMaxOpenedFiles = 10

Variables

View Source
var ErrAlreadyClosed = errors.New("multi-appendable already closed")
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 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 Open

func Open(path string, opts *Options) (*MultiFileAppendable, error)

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 (*MultiFileAppendable) Flush

func (mf *MultiFileAppendable) Flush() error

func (*MultiFileAppendable) FlushWithId added in v1.0.5

func (mf *MultiFileAppendable) FlushWithId(appID int64) 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) 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 (opt *Options) GetFileExt() string

func (*Options) GetFileMode added in v1.0.5

func (opt *Options) GetFileMode() os.FileMode

func (*Options) Valid added in v1.0.5

func (opts *Options) Valid() bool

func (*Options) WithCompresionLevel

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

func (*Options) WithCompressionFormat

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

func (*Options) WithFileExt

func (opt *Options) WithFileExt(fileExt string) *Options

func (*Options) WithFileMode

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

func (*Options) WithFileSize

func (opt *Options) WithFileSize(fileSize int) *Options

func (*Options) WithMaxOpenedFiles

func (opt *Options) WithMaxOpenedFiles(maxOpenedFiles int) *Options

func (*Options) WithMetadata

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

func (*Options) WithReadOnly

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

func (*Options) WithSynced

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

Jump to

Keyboard shortcuts

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