hashcache

package
v0.3.0-pre6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package hashcache implements streaming cache of file hashes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name     string    `json:"name,omitempty"`
	Hash     uint64    `json:"hash,omitempty"`
	ObjectID object.ID `json:"oid,omitempty"`
}

Entry represents an entry in hash cache database about single file or directory.

type Reader

type Reader interface {
	FindEntry(relativeName string) *Entry
	CopyTo(w Writer) error
}

Reader supports reading a stream of hash cache entries.

func Open

func Open(r io.Reader) Reader

Open starts reading hash cache content.

type Writer

type Writer interface {
	WriteEntry(e Entry) error
	Finalize() error
}

Writer emits hash cache entries.

func NewWriter

func NewWriter(w io.Writer) Writer

NewWriter creates new hash cache Writer.

Jump to

Keyboard shortcuts

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