server: Index | Files

package digest

import ""

Package digest handles content digest for remote executon API,


Package Files

digest.go digest_cache.go digest_store.go


var (
    DefaultViews = []*view.View{
            Name:        "",
            Description: `number of digest cache entries`,
            Measure:     cacheStats,
            Aggregation: view.Sum(),
            Name:        "",
            Description: `digest cache operations`,
            Measure:     cacheStats,
            TagKeys: []tag.Key{
            Aggregation: view.Count(),

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, maxEntries int) *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

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 20 packages (graph) and is imported by 6 packages. Updated 2020-10-27. Refresh now. Tools for package owners.