appendable

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Copyright 2019-2020 vChain, Inc.

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 2019-2020 vChain, Inc.

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 2019-2020 vChain, Inc.

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 (
	NoCompression = iota
	FlateCompression
	GZipCompression
	LZWCompression
	ZLibCompression
)
View Source
const (
	BestSpeed          = flate.BestSpeed
	BestCompression    = flate.BestCompression
	DefaultCompression = flate.DefaultCompression
	HuffmanOnly        = flate.HuffmanOnly
)
View Source
const DefaultCompressionFormat = NoCompression
View Source
const DefaultCompressionLevel = BestSpeed

Variables

This section is empty.

Functions

This section is empty.

Types

type Appendable

type Appendable interface {
	Metadata() []byte
	Size() (int64, error)
	Offset() int64
	SetOffset(off int64) error
	Append(bs []byte) (off int64, n int, err error)
	Flush() error
	Sync() error
	ReadAt(bs []byte, off int64) (int, error)
	Close() error
}

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

func NewMetadata

func NewMetadata(b []byte) *Metadata

func (*Metadata) Bytes

func (m *Metadata) Bytes() []byte

func (*Metadata) Get

func (m *Metadata) Get(key string) ([]byte, bool)

func (*Metadata) GetInt

func (m *Metadata) GetInt(key string) (int, bool)

func (*Metadata) Put

func (m *Metadata) Put(key string, value []byte)

func (*Metadata) PutInt

func (m *Metadata) PutInt(key string, n int)

func (*Metadata) ReadFrom

func (m *Metadata) ReadFrom(r io.Reader) (int64, error)

func (*Metadata) WriteTo

func (m *Metadata) WriteTo(w io.Writer) (n int64, err error)

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReaderFrom

func NewReaderFrom(rAt io.ReaderAt, off int64, size int) *Reader

func (*Reader) Offset

func (r *Reader) Offset() int64

func (*Reader) Read

func (r *Reader) Read(bs []byte) (n int, err error)

func (*Reader) ReadByte

func (r *Reader) ReadByte() (byte, error)

func (*Reader) ReadUint32

func (r *Reader) ReadUint32() (uint32, error)

func (*Reader) ReadUint64

func (r *Reader) ReadUint64() (uint64, error)

func (*Reader) Reset

func (r *Reader) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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