manifest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

func (*Header) Meta

func (h *Header) Meta() indexmeta.Meta

Meta returns the metadata of the manifest.

func (*Header) Version

func (h *Header) Version() uint64

Version returns the version of the manifest.

type Manifest

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

func NewManifest

func NewManifest(filename string, meta indexmeta.Meta) (*Manifest, error)

NewManifest creates a new manifest or opens an existing one.

func (*Manifest) Close

func (m *Manifest) Close() error

func (*Manifest) ContentSizeBytes

func (m *Manifest) ContentSizeBytes() (int64, error)

ContentSizeBytes returns the size of the content in bytes (not including the header).

func (*Manifest) Flush

func (m *Manifest) Flush() error

Flush flushes the cache to disk.

func (*Manifest) Meta

func (m *Manifest) Meta() indexmeta.Meta

func (*Manifest) Put

func (m *Manifest) Put(key, value uint64) error

Put appends the given uint64 tuple to the file.

func (*Manifest) ReadAll

func (m *Manifest) ReadAll() (Values, error)

ReadAll reads all the uint64 tuples from the file.

func (*Manifest) Version

func (m *Manifest) Version() uint64

type Values

type Values [][2]uint64

func (Values) First

func (v Values) First() ([2]uint64, bool)

First returns the first value in the slice.

func (Values) Last

func (v Values) Last() ([2]uint64, bool)

Last returns the last value in the slice.

Jump to

Keyboard shortcuts

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