server: go.chromium.org/goma/server/remoteexec/digest Index | Files

package digest

import "go.chromium.org/goma/server/remoteexec/digest"

Package digest handles content digest for remote executon API, https://github.com/bazelbuild/remote-apis/blob/c1c1ad2c97ed18943adb55f06657440daa60d833/build/bazel/remote/execution/v2/remote_execution.proto#L633

Index

Package Files

digest.go digest_cache.go digest_store.go

type Cache Uses

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

Cache caches file's digest data.

func NewCache Uses

func NewCache(c cachepb.CacheServiceClient) *Cache

NewCache creates new cache for digest data.

func (*Cache) Get Uses

func (c *Cache) Get(ctx context.Context, key string, src Source) (Data, error)

Get gets source's digest.

type Data Uses

type Data interface {
    Digest() *rpb.Digest
    Source
}

Data is data identified by digest.

func Bytes Uses

func Bytes(name string, b []byte) Data

Bytes creates data for bytes.

func FromSource Uses

func FromSource(ctx context.Context, src Source) (Data, error)

FromSource creates digests from source.

func New Uses

func New(src Source, d *rpb.Digest) Data

New creates digest data from source, which digest is d.

func Proto Uses

func Proto(m proto.Message) (Data, error)

Proto creates data for proto message.

type Source Uses

type Source interface {
    Open(context.Context) (io.ReadCloser, error)
    String() string
}

Source accesses data source for the digest.

type Store Uses

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

Store works as local content addressable storage.

func NewStore Uses

func NewStore() *Store

NewStore creates new local content addressable storage.

func (*Store) Get Uses

func (s *Store) Get(digest *rpb.Digest) (Data, bool)

Get gets data from store.

func (*Store) GetSource Uses

func (s *Store) GetSource(digest *rpb.Digest) (Source, bool)

GetSource gets source from store.

func (*Store) List Uses

func (s *Store) List() []*rpb.Digest

List lists known digests in cas.

func (*Store) Set Uses

func (s *Store) Set(data Data)

Set sets data in store.

Package digest imports 15 packages (graph) and is imported by 6 packages. Updated 2019-11-08. Refresh now. Tools for package owners.