Proto

package
v0.0.0-...-4c5daf2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_Client_server_Proto_Proto_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Proto.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Method",
			Handler:    _Service_Method_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _Service_Leave_Handler,
		},
		{
			MethodName: "createID",
			Handler:    _Service_CreateID_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Join",
			Handler:       _Service_Join_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "Client-server/Proto/Proto.proto",
}

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

Functions

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type JoinRequest

type JoinRequest struct {
	Id   int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*JoinRequest) Descriptor deprecated

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

Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.

func (*JoinRequest) GetId

func (x *JoinRequest) GetId() int32

func (*JoinRequest) GetTime

func (x *JoinRequest) GetTime() int32

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) ProtoReflect

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

func (*JoinRequest) Reset

func (x *JoinRequest) Reset()

func (*JoinRequest) String

func (x *JoinRequest) String() string

type LeaveRequest

type LeaveRequest struct {
	Id   int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaveRequest) Descriptor deprecated

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

Deprecated: Use LeaveRequest.ProtoReflect.Descriptor instead.

func (*LeaveRequest) GetId

func (x *LeaveRequest) GetId() int32

func (*LeaveRequest) GetTime

func (x *LeaveRequest) GetTime() int32

func (*LeaveRequest) ProtoMessage

func (*LeaveRequest) ProtoMessage()

func (*LeaveRequest) ProtoReflect

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

func (*LeaveRequest) Reset

func (x *LeaveRequest) Reset()

func (*LeaveRequest) String

func (x *LeaveRequest) String() string

type NodeId

type NodeId struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeId) Descriptor deprecated

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

Deprecated: Use NodeId.ProtoReflect.Descriptor instead.

func (*NodeId) GetId

func (x *NodeId) GetId() int32

func (*NodeId) ProtoMessage

func (*NodeId) ProtoMessage()

func (*NodeId) ProtoReflect

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

func (*NodeId) Reset

func (x *NodeId) Reset()

func (*NodeId) String

func (x *NodeId) String() string

type Object

type Object struct {
	// contains filtered or unexported fields
}

The request message containing the user's message

func (*Object) Descriptor deprecated

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

Deprecated: Use Object.ProtoReflect.Descriptor instead.

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) ProtoReflect

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

func (*Object) Reset

func (x *Object) Reset()

func (*Object) String

func (x *Object) String() string

type ServerResponse

type ServerResponse struct {
	HttpStatusCode int32 `protobuf:"varint,1,opt,name=HttpStatusCode,proto3" json:"HttpStatusCode,omitempty"`
	Time           int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*ServerResponse) Descriptor deprecated

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

Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.

func (*ServerResponse) GetHttpStatusCode

func (x *ServerResponse) GetHttpStatusCode() int32

func (*ServerResponse) GetTime

func (x *ServerResponse) GetTime() int32

func (*ServerResponse) ProtoMessage

func (*ServerResponse) ProtoMessage()

func (*ServerResponse) ProtoReflect

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

func (*ServerResponse) Reset

func (x *ServerResponse) Reset()

func (*ServerResponse) String

func (x *ServerResponse) String() string

type ServiceClient

type ServiceClient interface {
	// Sends a stream of messages and gets a stream of messages in return
	Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (Service_JoinClient, error)
	Method(ctx context.Context, in *Object, opts ...grpc.CallOption) (*ServerResponse, error)
	Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*ServerResponse, error)
	//Gets an ID(which is irrelevant) and returns the next ID in the line
	CreateID(ctx context.Context, in *NodeId, opts ...grpc.CallOption) (*NodeId, error)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	// Sends a stream of messages and gets a stream of messages in return
	Join(*JoinRequest, Service_JoinServer) error
	Method(context.Context, *Object) (*ServerResponse, error)
	Leave(context.Context, *LeaveRequest) (*ServerResponse, error)
	//Gets an ID(which is irrelevant) and returns the next ID in the line
	CreateID(context.Context, *NodeId) (*NodeId, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type Service_JoinClient

type Service_JoinClient interface {
	Recv() (*Object, error)
	grpc.ClientStream
}

type Service_JoinServer

type Service_JoinServer interface {
	Send(*Object) error
	grpc.ServerStream
}

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) CreateID

func (UnimplementedServiceServer) Join

func (UnimplementedServiceServer) Leave

func (UnimplementedServiceServer) Method

type UnsafeServiceServer

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

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

Jump to

Keyboard shortcuts

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