Documentation ¶
Index ¶
- Variables
- type CacheEx
- func (c *CacheEx) Contains(ctx context.Context, kind cache.EntryKind, digest *pb.Digest) (bool, error)
- func (c *CacheEx) Get(ctx context.Context, kind cache.EntryKind, digest *pb.Digest) (io.ReadCloser, error)
- func (c *CacheEx) GetBytes(ctx context.Context, kind cache.EntryKind, digest *pb.Digest) ([]byte, error)
- func (c *CacheEx) GetProto(ctx context.Context, kind cache.EntryKind, digest *pb.Digest, ...) error
- func (c *CacheEx) GetRange(ctx context.Context, kind cache.EntryKind, digest *pb.Digest, ...) (io.ReadCloser, error)
- func (c *CacheEx) Put(ctx context.Context, kind cache.EntryKind, digest *pb.Digest) (io.WriteCloser, error)
- func (c *CacheEx) PutBytes(ctx context.Context, kind cache.EntryKind, digest *pb.Digest, data []byte) error
- func (c *CacheEx) PutProto(ctx context.Context, kind cache.EntryKind, digest *pb.Digest, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrACNotFound = errors.New("ActionResult not found or not complete")
)
View Source
var (
ErrInvalidResourceName = errors.New("invalid resource name")
)
View Source
var (
ErrInvalidSize = errors.New("invalid size")
)
View Source
var ServeCmd = &cobra.Command{ Use: "serve", Short: "Starts the Bazel cache gRPC server", RunE: func(cmd *cobra.Command, args []string) error { listenAddr := serveCmdFlags.listenAddr if serveCmdFlags.portFromEnv != "" { listenAddr = ":" + os.Getenv(serveCmdFlags.portFromEnv) } lis, err := net.Listen("tcp", listenAddr) if err != nil { return err } defer lis.Close() zap.L().With( zap.String("addr", lis.Addr().String()), zap.String("cache", serveCmdFlags.cacheURI), ).Info("Listening") cc, err := cache.NewCacheFromURI(context.Background(), serveCmdFlags.cacheURI) if err != nil { return err } cs := &cacheServer{ cache: NewCacheEx(cc), } grpcServer := grpc.NewServer( grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( grpc_zap.StreamServerInterceptor(zap.L()), )), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( grpc_zap.UnaryServerInterceptor(zap.L()), )), grpc.ReadBufferSize(maxChunkSize), grpc.WriteBufferSize(maxChunkSize), ) pb.RegisterActionCacheServer(grpcServer, cs) pb.RegisterCapabilitiesServer(grpcServer, cs) pb.RegisterContentAddressableStorageServer(grpcServer, cs) bytestream.RegisterByteStreamServer(grpcServer, cs) reflection.Register(grpcServer) return grpcServer.Serve(lis) }, }
Functions ¶
This section is empty.
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.