actioncache

package
v0.0.0-...-9febfc8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package actioncache implements the REAPI ActionCache service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

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.

func (*ActionCache) Remove

func (c *ActionCache) Remove(d digest.Digest) error

Remove deletes the cached 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

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.

Jump to

Keyboard shortcuts

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