proto

package
v0.0.0-...-5e50992 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stream_PersistentStream_FullMethodName = "/stream.Stream/PersistentStream"
)

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "Data",
		1: "Deny",
		2: "AddRoute",
		3: "DelRoute",
		4: "Assign",
	}
	Type_value = map[string]int32{
		"Data":     0,
		"Deny":     1,
		"AddRoute": 2,
		"DelRoute": 3,
		"Assign":   4,
	}
)

Enum value maps for Type.

View Source
var File_proto_stream_proto protoreflect.FileDescriptor
View Source
var Stream_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "stream.Stream",
	HandlerType: (*StreamServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PersistentStream",
			Handler:       _Stream_PersistentStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/stream.proto",
}

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

Functions

func RegisterStreamServer

func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer)

Types

type Message

type Message struct {
	Code    Type   `protobuf:"varint,1,opt,name=Code,proto3,enum=stream.Type" json:"Code,omitempty"` // 类型
	Data    []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`                   // 数据
	Gateway string `protobuf:"bytes,3,opt,name=Gateway,proto3" json:"Gateway,omitempty"`             // 网关地址
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCode

func (x *Message) GetCode() Type

func (*Message) GetData

func (x *Message) GetData() []byte

func (*Message) GetGateway

func (x *Message) GetGateway() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type StreamClient

type StreamClient interface {
	PersistentStream(ctx context.Context, opts ...grpc.CallOption) (Stream_PersistentStreamClient, error)
}

StreamClient is the client API for Stream 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.

func NewStreamClient

func NewStreamClient(cc grpc.ClientConnInterface) StreamClient

type StreamServer

type StreamServer interface {
	PersistentStream(Stream_PersistentStreamServer) error
	// contains filtered or unexported methods
}

StreamServer is the server API for Stream service. All implementations must embed UnimplementedStreamServer for forward compatibility

type Stream_PersistentStreamClient

type Stream_PersistentStreamClient interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type Stream_PersistentStreamServer

type Stream_PersistentStreamServer interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type Type

type Type int32
const (
	Type_Data     Type = 0 // 数据
	Type_Deny     Type = 1 // 拒绝
	Type_AddRoute Type = 2 // 添加路由
	Type_DelRoute Type = 3 // 删除路由
	Type_Assign   Type = 4 // 分配IP地址
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

func (Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

type UnimplementedStreamServer

type UnimplementedStreamServer struct {
}

UnimplementedStreamServer must be embedded to have forward compatible implementations.

func (UnimplementedStreamServer) PersistentStream

type UnsafeStreamServer

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

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

Jump to

Keyboard shortcuts

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