Documentation
¶
Overview ¶
Package digest handles content digests of remote executon API.
You can find the Digest proto in REAPI here: https://github.com/bazelbuild/remote-apis/blob/c1c1ad2c97ed18943adb55f06657440daa60d833/build/bazel/remote/execution/v2/remote_execution.proto#L633
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Empty = ofBytes([]byte{})
Empty is a digest of empty content.
Functions ¶
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data is a data instance that consists of Digest and Source. TODO(b/268407930): it may be possible to be merged with Source.
func FromLocalFile ¶
FromLocalFile creates Data from local file source. it requires LocalFileSource because it doesn't handle retriable err from src.
func FromProtoMessage ¶
FromProtoMessage creates Data from proto message.
type Digest ¶
type Digest struct { Hash string `json:"hash,omitempty"` SizeBytes int64 `json:"size_bytes,omitempty"` }
Digest is a digest.
func Parse ¶
Parse parses digest string representation. It accepts the following string formats.
- hash/size_bytes
- json representation of digest.
- proto text representation of digest.
type LocalFileSource ¶
type LocalFileSource interface { Source IsLocal() }
LocalFileSource is a source for local file.
type Source ¶
type Source interface { // Open returns io.ReadCloser of the source. Open(context.Context) (io.ReadCloser, error) // String returns the name of the data source. String() string }
Source is the interface that opens a data source. It can be remote or local source. If this interface is implemented based on gRPC streaming for remote sources, the caller may need to retry Open/Read/Close in addition.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store works as an in-memory content addressable storage.