compare

package
v0.0.0-...-c426cd6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllChunkSums

func AllChunkSums(lister drive.ChunkLister) ([][]byte, error)

AllChunkSums iterates lister. It gathers and returns all of the sums.

Nb: It is intended only for use on relatively small Shade repositorites. Depending on the client, it may consume a lot of ram and take a very long time to run.

func Equal

func Equal(a, b drive.Client) (bool, error)

Equal returns true if client a and b return the same sums via ListFiles and their ChunkLister interface.

See the disclaimers for GetDelta, which this is a thin veneer on top of.

func GetDelta

func GetDelta(a, b drive.Client) (Delta, Delta, error)

GetDelta iterates the files and chunks in two drive clients, and returns two Delta structs, containing slices of files and chunks. The return values are:

  • files and chunks that a has that b does not
  • files and chunks that b has that a does not
  • an error, if one was encountered

Nb: This is intended only for use on relatively small Shade repositorites, primarily for testing. Depending on the client, it may consume a lot of ram and take a very long time to run.

Nb: it does not validate the clients contain the same actual bytes, it trusts the sums reported by ListFiles and the ChunkLister interface.

Types

type Delta

type Delta struct {
	Files  [][]byte
	Chunks [][]byte
}

Delta describes the extra file and chunk sums known to one client, which are not known to the other.

Jump to

Keyboard shortcuts

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