cache

package
v0.0.0-...-07f7db3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package cache implements a package cache, or more properly a build artifact cache, but our only cached build artifacts are packages.

Index

Constants

View Source
const HashSize = 32

HashSize is the number of bytes in a hash.

Variables

This section is empty.

Functions

func HashFile

func HashFile(file string) ([HashSize]byte, error)

HashFile returns the hash of the named file.

Types

type ActionID

type ActionID [HashSize]byte

An ActionID is a cache action key, the hash of a complete description of a repeatable computation (command line, environment variables, input file contents, executable contents).

type Hash

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

A Hash provides access to the canonical hash function used to index the cache. The current implementation uses SHA256, but clients must not assume this.

func NewHash

func NewHash(name string) *Hash

NewHash returns a new Hash. The caller is expected to Write data to it and then call Sum.

func (*Hash) Sum

func (h *Hash) Sum() [HashSize]byte

Sum returns the hash of the data written previously.

func (*Hash) Write

func (h *Hash) Write(b []byte) (int, error)

Write writes data to the running hash.

Jump to

Keyboard shortcuts

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