cache

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrScheme      = errors.New("wrong or invalid scheme requested")
	ErrUnavailable = errors.New("item is not available in cache")
)

Functions

func CommonGRPCClientOptions

func CommonGRPCClientOptions() []grpc.DialOption

func DialTarget

func DialTarget(target string, credentials string) (*grpc.ClientConn, error)

func DialTargetWithOptions

func DialTargetWithOptions(target string, grpcsBytestream bool, credentials string, extraOptions ...grpc.DialOption) (*grpc.ClientConn, error)

Types

type BazelCache

type BazelCache interface {
	Read(ctx context.Context, secure bool, uri string) ([]byte, error)
}

BazelCache allows reading objects directly from Bazel's caches. This might be necessary when one needs access to output files, because Bazel might not materialize the file on disk if the result is cached.

func NewDefaultDelegatingCache

func NewDefaultDelegatingCache(credentials string, dialOptions ...grpc.DialOption) BazelCache

type DelegatingBazelCache

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

DelegatingBazelCache consists of multiple BazelCaches, and uses the one appropriate for a given uri by looking at the scheme.

func (*DelegatingBazelCache) Read

func (c *DelegatingBazelCache) Read(ctx context.Context, secure bool, uri string) ([]byte, error)

type FileBazelCache

type FileBazelCache struct{}

FileBazelCache provides access to cached items with 'file://' uris.

func (*FileBazelCache) Read

func (c *FileBazelCache) Read(ctx context.Context, secure bool, uri string) ([]byte, error)

type RemoteBazelCache

type RemoteBazelCache struct {
	DialOptions []grpc.DialOption
	// contains filtered or unexported fields
}

RemoteBazelCache provides access to cached items with 'bytestream://' uris.

func (*RemoteBazelCache) Read

func (c *RemoteBazelCache) Read(ctx context.Context, secure bool, uri string) ([]byte, error)

Jump to

Keyboard shortcuts

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