mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
The reasoner-admin gRPC service, its middleware, and the generated *_grpc.pb.go now require -tags grpc to compile. Default builds use only the ZAP-native admin path. The adminpb stub keeps `UnimplementedAdminReasonerServiceServer` available as a zero-field struct so embedders compile. Generated file regen via protoc will erase the build constraint — inline comment in reasoner_admin_grpc.pb.go flags this for the next person who runs the codegen.
135 lines
5.5 KiB
Go
135 lines
5.5 KiB
Go
//go:build grpc
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v6.33.4
|
|
// source: proto/admin/reasoner_admin.proto
|
|
//
|
|
// Hide gRPC behind the `grpc` build tag. Default builds compile only the
|
|
// protobuf message types from reasoner_admin.pb.go; rebuild with -tags grpc
|
|
// to enable the gRPC client/server stubs in this file. Regenerating with
|
|
// protoc will drop this tag — keep the build constraint after every regen.
|
|
|
|
package adminpb
|
|
|
|
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 (
|
|
AdminReasonerService_ListReasoners_FullMethodName = "/admin.v1.AdminReasonerService/ListReasoners"
|
|
)
|
|
|
|
// AdminReasonerServiceClient is the client API for AdminReasonerService 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.
|
|
//
|
|
// AdminReasonerService exposes control-surface operations for reasoning components.
|
|
type AdminReasonerServiceClient interface {
|
|
// ListReasoners returns the set of registered reasoners and their parent nodes.
|
|
ListReasoners(ctx context.Context, in *ListReasonersRequest, opts ...grpc.CallOption) (*ListReasonersResponse, error)
|
|
}
|
|
|
|
type adminReasonerServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAdminReasonerServiceClient(cc grpc.ClientConnInterface) AdminReasonerServiceClient {
|
|
return &adminReasonerServiceClient{cc}
|
|
}
|
|
|
|
func (c *adminReasonerServiceClient) ListReasoners(ctx context.Context, in *ListReasonersRequest, opts ...grpc.CallOption) (*ListReasonersResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListReasonersResponse)
|
|
err := c.cc.Invoke(ctx, AdminReasonerService_ListReasoners_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AdminReasonerServiceServer is the server API for AdminReasonerService service.
|
|
// All implementations must embed UnimplementedAdminReasonerServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// AdminReasonerService exposes control-surface operations for reasoning components.
|
|
type AdminReasonerServiceServer interface {
|
|
// ListReasoners returns the set of registered reasoners and their parent nodes.
|
|
ListReasoners(context.Context, *ListReasonersRequest) (*ListReasonersResponse, error)
|
|
mustEmbedUnimplementedAdminReasonerServiceServer()
|
|
}
|
|
|
|
// UnimplementedAdminReasonerServiceServer 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 UnimplementedAdminReasonerServiceServer struct{}
|
|
|
|
func (UnimplementedAdminReasonerServiceServer) ListReasoners(context.Context, *ListReasonersRequest) (*ListReasonersResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListReasoners not implemented")
|
|
}
|
|
func (UnimplementedAdminReasonerServiceServer) mustEmbedUnimplementedAdminReasonerServiceServer() {}
|
|
func (UnimplementedAdminReasonerServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAdminReasonerServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AdminReasonerServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAdminReasonerServiceServer interface {
|
|
mustEmbedUnimplementedAdminReasonerServiceServer()
|
|
}
|
|
|
|
func RegisterAdminReasonerServiceServer(s grpc.ServiceRegistrar, srv AdminReasonerServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedAdminReasonerServiceServer 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(&AdminReasonerService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AdminReasonerService_ListReasoners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListReasonersRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AdminReasonerServiceServer).ListReasoners(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AdminReasonerService_ListReasoners_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AdminReasonerServiceServer).ListReasoners(ctx, req.(*ListReasonersRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AdminReasonerService_ServiceDesc is the grpc.ServiceDesc for AdminReasonerService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AdminReasonerService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "admin.v1.AdminReasonerService",
|
|
HandlerType: (*AdminReasonerServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ListReasoners",
|
|
Handler: _AdminReasonerService_ListReasoners_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "proto/admin/reasoner_admin.proto",
|
|
}
|