proto

package
v0.0.0-...-bb27e5e Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeService_Connect_FullMethodName = "/protocol.NodeService/Connect"
)

Variables

View Source
var NodeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protocol.NodeService",
	HandlerType: (*NodeServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _NodeService_Connect_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "node.proto",
}

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

Functions

func RegisterNodeServiceServer

func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)

Types

type Envelope

type Envelope struct {
	Id            string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                                            // 消息ID
	Type          int32             `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`                                       // 消息类型
	Payload       []byte            `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`                                  // 消息内容
	From          string            `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`                                        // 发送方
	To            string            `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"`                                            // 接收方
	CorrelationId string            `protobuf:"bytes,6,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"` // 关联ID(用于请求-响应匹配)
	Timestamp     int64             `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`                             // 时间戳
	Meta          map[string]string ``                                                                                                     // 元数据
	/* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

Envelope 消息信封

func (*Envelope) Descriptor deprecated

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

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetCorrelationId

func (x *Envelope) GetCorrelationId() string

func (*Envelope) GetFrom

func (x *Envelope) GetFrom() string

func (*Envelope) GetId

func (x *Envelope) GetId() string

func (*Envelope) GetMeta

func (x *Envelope) GetMeta() map[string]string

func (*Envelope) GetPayload

func (x *Envelope) GetPayload() []byte

func (*Envelope) GetTimestamp

func (x *Envelope) GetTimestamp() int64

func (*Envelope) GetTo

func (x *Envelope) GetTo() string

func (*Envelope) GetType

func (x *Envelope) GetType() int32

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

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

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

type NodeServiceClient

type NodeServiceClient interface {
	// Connect 建立双向流连接
	Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Envelope, Envelope], error)
}

NodeServiceClient is the client API for NodeService 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.

NodeService 节点通信服务

type NodeServiceServer

type NodeServiceServer interface {
	// Connect 建立双向流连接
	Connect(grpc.BidiStreamingServer[Envelope, Envelope]) error
	// contains filtered or unexported methods
}

NodeServiceServer is the server API for NodeService service. All implementations must embed UnimplementedNodeServiceServer for forward compatibility.

NodeService 节点通信服务

type NodeService_ConnectClient

type NodeService_ConnectClient = grpc.BidiStreamingClient[Envelope, Envelope]

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

type NodeService_ConnectServer

type NodeService_ConnectServer = grpc.BidiStreamingServer[Envelope, Envelope]

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

type UnimplementedNodeServiceServer

type UnimplementedNodeServiceServer struct{}

UnimplementedNodeServiceServer 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 (UnimplementedNodeServiceServer) Connect

type UnsafeNodeServiceServer

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

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

Jump to

Keyboard shortcuts

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