waymaker-client/go/genpb/cache/cache_grpc.pb.go

210 lines
8.5 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.34.1
// source: cache.proto
package waymaker_cache
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
WaymakerCacheService_AttachPolicy_FullMethodName = "/waymaker.cache.WaymakerCacheService/AttachPolicy"
WaymakerCacheService_DetachPolicy_FullMethodName = "/waymaker.cache.WaymakerCacheService/DetachPolicy"
WaymakerCacheService_Stats_FullMethodName = "/waymaker.cache.WaymakerCacheService/Stats"
)
// WaymakerCacheServiceClient is the client API for WaymakerCacheService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type WaymakerCacheServiceClient interface {
// Apply a TTL policy to a bucket. `policy_id` selects from
// server-configured policies (initially: `lru`, `expiry`).
AttachPolicy(ctx context.Context, in *AttachPolicyRequest, opts ...grpc.CallOption) (*AttachPolicyResponse, error)
// Detach the policy currently bound to `bucket` (no-op if
// none).
DetachPolicy(ctx context.Context, in *DetachPolicyRequest, opts ...grpc.CallOption) (*DetachPolicyResponse, error)
// Report current cache stats (hit/miss/eviction counters,
// memory footprint) for a bucket.
Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)
}
type waymakerCacheServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWaymakerCacheServiceClient(cc grpc.ClientConnInterface) WaymakerCacheServiceClient {
return &waymakerCacheServiceClient{cc}
}
func (c *waymakerCacheServiceClient) AttachPolicy(ctx context.Context, in *AttachPolicyRequest, opts ...grpc.CallOption) (*AttachPolicyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AttachPolicyResponse)
err := c.cc.Invoke(ctx, WaymakerCacheService_AttachPolicy_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waymakerCacheServiceClient) DetachPolicy(ctx context.Context, in *DetachPolicyRequest, opts ...grpc.CallOption) (*DetachPolicyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DetachPolicyResponse)
err := c.cc.Invoke(ctx, WaymakerCacheService_DetachPolicy_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waymakerCacheServiceClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatsResponse)
err := c.cc.Invoke(ctx, WaymakerCacheService_Stats_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WaymakerCacheServiceServer is the server API for WaymakerCacheService service.
// All implementations must embed UnimplementedWaymakerCacheServiceServer
// for forward compatibility.
type WaymakerCacheServiceServer interface {
// Apply a TTL policy to a bucket. `policy_id` selects from
// server-configured policies (initially: `lru`, `expiry`).
AttachPolicy(context.Context, *AttachPolicyRequest) (*AttachPolicyResponse, error)
// Detach the policy currently bound to `bucket` (no-op if
// none).
DetachPolicy(context.Context, *DetachPolicyRequest) (*DetachPolicyResponse, error)
// Report current cache stats (hit/miss/eviction counters,
// memory footprint) for a bucket.
Stats(context.Context, *StatsRequest) (*StatsResponse, error)
mustEmbedUnimplementedWaymakerCacheServiceServer()
}
// UnimplementedWaymakerCacheServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedWaymakerCacheServiceServer struct{}
func (UnimplementedWaymakerCacheServiceServer) AttachPolicy(context.Context, *AttachPolicyRequest) (*AttachPolicyResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AttachPolicy not implemented")
}
func (UnimplementedWaymakerCacheServiceServer) DetachPolicy(context.Context, *DetachPolicyRequest) (*DetachPolicyResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DetachPolicy not implemented")
}
func (UnimplementedWaymakerCacheServiceServer) Stats(context.Context, *StatsRequest) (*StatsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Stats not implemented")
}
func (UnimplementedWaymakerCacheServiceServer) mustEmbedUnimplementedWaymakerCacheServiceServer() {}
func (UnimplementedWaymakerCacheServiceServer) testEmbeddedByValue() {}
// UnsafeWaymakerCacheServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WaymakerCacheServiceServer will
// result in compilation errors.
type UnsafeWaymakerCacheServiceServer interface {
mustEmbedUnimplementedWaymakerCacheServiceServer()
}
func RegisterWaymakerCacheServiceServer(s grpc.ServiceRegistrar, srv WaymakerCacheServiceServer) {
// If the following call panics, it indicates UnimplementedWaymakerCacheServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&WaymakerCacheService_ServiceDesc, srv)
}
func _WaymakerCacheService_AttachPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AttachPolicyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaymakerCacheServiceServer).AttachPolicy(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WaymakerCacheService_AttachPolicy_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaymakerCacheServiceServer).AttachPolicy(ctx, req.(*AttachPolicyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WaymakerCacheService_DetachPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DetachPolicyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaymakerCacheServiceServer).DetachPolicy(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WaymakerCacheService_DetachPolicy_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaymakerCacheServiceServer).DetachPolicy(ctx, req.(*DetachPolicyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WaymakerCacheService_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaymakerCacheServiceServer).Stats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WaymakerCacheService_Stats_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaymakerCacheServiceServer).Stats(ctx, req.(*StatsRequest))
}
return interceptor(ctx, in, info, handler)
}
// WaymakerCacheService_ServiceDesc is the grpc.ServiceDesc for WaymakerCacheService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WaymakerCacheService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "waymaker.cache.WaymakerCacheService",
HandlerType: (*WaymakerCacheServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AttachPolicy",
Handler: _WaymakerCacheService_AttachPolicy_Handler,
},
{
MethodName: "DetachPolicy",
Handler: _WaymakerCacheService_DetachPolicy_Handler,
},
{
MethodName: "Stats",
Handler: _WaymakerCacheService_Stats_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cache.proto",
}