worker

package
v0.0.0-...-ba09d25 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Overview

Package worker provides an implementation of the bazel worker protocol.

Tools may be written as a normal command line utility, except the passed run function may be invoked multiple times.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupDigest

func LookupDigest(filename string) (string, bool)

LookupDigest returns a digest for the given file.

func Work

func Work(run func([]string) int)

Work invokes the main function.

Types

type Cache

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

Cache is a worker cache.

They can be created via NewCache.

func NewCache

func NewCache(name string) *Cache

NewCache returns a new cache.

func (*Cache) Lookup

func (c *Cache) Lookup(filenames []string, generate func() Sizer) Sizer

Lookup looks up an entry in the cache.

It is a function of the given files.

type CacheBytes

type CacheBytes []byte

CacheBytes is an example of a Sizer.

func (CacheBytes) Size

func (cb CacheBytes) Size() int64

Size implements Sizer.Size.

type Sizer

type Sizer interface {
	Size() int64
}

Sizer returns a size.

Jump to

Keyboard shortcuts

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