layer

package
v0.0.0-...-111b784 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitMask0 byte = 1 << iota
	BitMask1
	BitMask2
	BitMask3
	BitMask4
	BitMask5
	BitMask6
	BitMask7
)
View Source
const (
	LayersDir = ".tmp-layers"
)

Variables

View Source
var Codecs = []string{
	"bzip2",
	"zlib",
	"gzip",
	"lzw",
}

Functions

func FileName

func FileName(layerCount int, codec string) string

func NewCodecReader

func NewCodecReader(r io.Reader, codec string) (io.ReadCloser, error)

func NewCodecWriter

func NewCodecWriter(w io.Writer, codec string) (io.WriteCloser, error)

Types

type Encoder

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

func NewEncoder

func NewEncoder(layerCount int) (*Encoder, error)

func (*Encoder) Close

func (ce *Encoder) Close() error

func (*Encoder) Encode

func (ce *Encoder) Encode(obj any)

func (*Encoder) GetSmallestResult

func (ce *Encoder) GetSmallestResult() ([]byte, string, error)

type Section

type Section struct {
	Layer           int
	SubSectionCount uint64
	NumberCount     uint64
	Codec           string
	Content         []byte
}

func (Section) DecodeSubSections

func (s Section) DecodeSubSections() ([]Section, error)