protogen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONRPCService_Transport_FullMethodName = "/jsonrpc.JSONRPCService/Transport"
)

Variables

View Source
var File_jsonrpc_proto protoreflect.FileDescriptor
View Source
var JSONRPCService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "jsonrpc.JSONRPCService",
	HandlerType: (*JSONRPCServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Transport",
			Handler:       _JSONRPCService_Transport_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "jsonrpc.proto",
}

JSONRPCService_ServiceDesc is the grpc.ServiceDesc for JSONRPCService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterJSONRPCServiceServer

func RegisterJSONRPCServiceServer(s grpc.ServiceRegistrar, srv JSONRPCServiceServer)

Types

type JSONRPCError

type JSONRPCError struct {
	Code    int32            `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string           `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Data    *structpb.Struct `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

JSONRPCError represents a JSON-RPC 2.0 error

func (*JSONRPCError) Descriptor deprecated

func (*JSONRPCError) Descriptor() ([]byte, []int)

Deprecated: Use JSONRPCError.ProtoReflect.Descriptor instead.

func (*JSONRPCError) GetCode

func (x *JSONRPCError) GetCode() int32

func (*JSONRPCError) GetData

func (x *JSONRPCError) GetData() *structpb.Struct

func (*JSONRPCError) GetMessage

func (x *JSONRPCError) GetMessage() string

func (*JSONRPCError) ProtoMessage

func (*JSONRPCError) ProtoMessage()

func (*JSONRPCError) ProtoReflect

func (x *JSONRPCError) ProtoReflect() protoreflect.Message

func (*JSONRPCError) Reset

func (x *JSONRPCError) Reset()

func (*JSONRPCError) String

func (x *JSONRPCError) String() string

type JSONRPCMessage

type JSONRPCMessage struct {
	Jsonrpc string `protobuf:"bytes,1,opt,name=jsonrpc,proto3" json:"jsonrpc,omitempty"`
	// ID can be either string or number
	//
	// Types that are valid to be assigned to Id:
	//
	//	*JSONRPCMessage_IdString
	//	*JSONRPCMessage_IdNumber
	Id isJSONRPCMessage_Id `protobuf_oneof:"id"`
	// For requests and notifications
	Method string           `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"`
	Params *structpb.Struct `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"`
	// For responses
	Result *structpb.Struct `protobuf:"bytes,6,opt,name=result,proto3" json:"result,omitempty"`
	// For errors
	Error *JSONRPCError `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

JSONRPCMessage represents a JSON-RPC 2.0 message

func (*JSONRPCMessage) Descriptor deprecated

func (*JSONRPCMessage) Descriptor() ([]byte, []int)

Deprecated: Use JSONRPCMessage.ProtoReflect.Descriptor instead.

func (*JSONRPCMessage) GetError

func (x *JSONRPCMessage) GetError() *JSONRPCError

func (*JSONRPCMessage) GetId

func (x *JSONRPCMessage) GetId() isJSONRPCMessage_Id

func (*JSONRPCMessage) GetIdNumber

func (x *JSONRPCMessage) GetIdNumber() int64

func (*JSONRPCMessage) GetIdString

func (x *JSONRPCMessage) GetIdString() string

func (*JSONRPCMessage) GetJsonrpc

func (x *JSONRPCMessage) GetJsonrpc() string

func (*JSONRPCMessage) GetMethod

func (x *JSONRPCMessage) GetMethod() string

func (*JSONRPCMessage) GetParams

func (x *JSONRPCMessage) GetParams() *structpb.Struct

func (*JSONRPCMessage) GetResult

func (x *JSONRPCMessage) GetResult() *structpb.Struct

func (*JSONRPCMessage) ProtoMessage

func (*JSONRPCMessage) ProtoMessage()

func (*JSONRPCMessage) ProtoReflect

func (x *JSONRPCMessage) ProtoReflect() protoreflect.Message

func (*JSONRPCMessage) Reset

func (x *JSONRPCMessage) Reset()

func (*JSONRPCMessage) String

func (x *JSONRPCMessage) String() string

type JSONRPCMessage_IdNumber

type JSONRPCMessage_IdNumber struct {
	IdNumber int64 `protobuf:"varint,3,opt,name=id_number,json=idNumber,proto3,oneof"`
}

type JSONRPCMessage_IdString

type JSONRPCMessage_IdString struct {
	IdString string `protobuf:"bytes,2,opt,name=id_string,json=idString,proto3,oneof"`
}

type JSONRPCServiceClient

type JSONRPCServiceClient interface {
	// Transport establishes a bidirectional stream for JSON-RPC messages
	Transport(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[JSONRPCMessage, JSONRPCMessage], error)
}

JSONRPCServiceClient is the client API for JSONRPCService 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.

JSONRPCService defines the bidirectional streaming service for MCP over gRPC

type JSONRPCServiceServer

type JSONRPCServiceServer interface {
	// Transport establishes a bidirectional stream for JSON-RPC messages
	Transport(grpc.BidiStreamingServer[JSONRPCMessage, JSONRPCMessage]) error
	// contains filtered or unexported methods
}

JSONRPCServiceServer is the server API for JSONRPCService service. All implementations must embed UnimplementedJSONRPCServiceServer for forward compatibility.

JSONRPCService defines the bidirectional streaming service for MCP over gRPC

type JSONRPCService_TransportClient

type JSONRPCService_TransportClient = grpc.BidiStreamingClient[JSONRPCMessage, JSONRPCMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type JSONRPCService_TransportServer

type JSONRPCService_TransportServer = grpc.BidiStreamingServer[JSONRPCMessage, JSONRPCMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnimplementedJSONRPCServiceServer

type UnimplementedJSONRPCServiceServer struct{}

UnimplementedJSONRPCServiceServer 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.

func (UnimplementedJSONRPCServiceServer) Transport

type UnsafeJSONRPCServiceServer

type UnsafeJSONRPCServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeJSONRPCServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JSONRPCServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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