Documentation
¶
Overview ¶
Package actioncache implements the REAPI ActionCache service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(s *grpc.Server, ac *ActionCache, cas *blobstore.ContentAddressableStorage) error
Register creates and registers a new Service with the given gRPC server.
Types ¶
type ActionCache ¶
type ActionCache struct {
// contains filtered or unexported fields
}
ActionCache is a simple action cache implementation that stores ActionResults on the local disk.
func New ¶
func New(dataDir string) (*ActionCache, error)
New creates a new local ActionCache. The data directory is created if it does not exist.
func (*ActionCache) Get ¶
func (c *ActionCache) Get(actionDigest digest.Digest) (*repb.ActionResult, error)
Get returns the cached ActionResult for the given digest.
func (*ActionCache) Put ¶
func (c *ActionCache) Put(actionDigest digest.Digest, ar *repb.ActionResult) error
Put stores the given ActionResult for the given digest.
type Service ¶
type Service struct { repb.UnimplementedActionCacheServer // contains filtered or unexported fields }
Service implements the REAPI ActionCache service.
func NewService ¶
func NewService(ac *ActionCache, cas *blobstore.ContentAddressableStorage) (Service, error)
NewService creates a new Service.
func (Service) GetActionResult ¶
func (s Service) GetActionResult(ctx context.Context, request *repb.GetActionResultRequest) (*repb.ActionResult, error)
GetActionResult returns the ActionResult for a given action digest.
func (Service) UpdateActionResult ¶
func (s Service) UpdateActionResult(ctx context.Context, request *repb.UpdateActionResultRequest) (*repb.ActionResult, error)
UpdateActionResult stores an ActionResult for a given action digest on disk.