protocol

package
v0.0.0-...-12f558f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterChatServer

func RegisterChatServer(s *grpc.Server, srv ChatServer)

Types

type ChatClient

type ChatClient interface {
	Send(ctx context.Context, in *Data, opts ...grpc.CallOption) (*empty.Empty, error)
	Receive(ctx context.Context, in *ID, opts ...grpc.CallOption) (Chat_ReceiveClient, error)
	Who(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ID, error)
}

ChatClient is the client API for Chat service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChatClient

func NewChatClient(cc grpc.ClientConnInterface) ChatClient

type ChatServer

type ChatServer interface {
	Send(context.Context, *Data) (*empty.Empty, error)
	Receive(*ID, Chat_ReceiveServer) error
	Who(context.Context, *empty.Empty) (*ID, error)
}

ChatServer is the server API for Chat service.

type Chat_ReceiveClient

type Chat_ReceiveClient interface {
	Recv() (*Data, error)
	grpc.ClientStream
}

type Chat_ReceiveServer

type Chat_ReceiveServer interface {
	Send(*Data) error
	grpc.ServerStream
}

type Data

type Data struct {
	Id                   *ID      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Data) Descriptor

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

func (*Data) GetId

func (m *Data) GetId() *ID

func (*Data) GetText

func (m *Data) GetText() string

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) Reset

func (m *Data) Reset()

func (*Data) String

func (m *Data) String() string

func (*Data) XXX_DiscardUnknown

func (m *Data) XXX_DiscardUnknown()

func (*Data) XXX_Marshal

func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Data) XXX_Merge

func (m *Data) XXX_Merge(src proto.Message)

func (*Data) XXX_Size

func (m *Data) XXX_Size() int

func (*Data) XXX_Unmarshal

func (m *Data) XXX_Unmarshal(b []byte) error

type ID

type ID struct {
	Id                   int32    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ID) Descriptor

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

func (*ID) GetId

func (m *ID) GetId() int32

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) Reset

func (m *ID) Reset()

func (*ID) String

func (m *ID) String() string

func (*ID) XXX_DiscardUnknown

func (m *ID) XXX_DiscardUnknown()

func (*ID) XXX_Marshal

func (m *ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ID) XXX_Merge

func (m *ID) XXX_Merge(src proto.Message)

func (*ID) XXX_Size

func (m *ID) XXX_Size() int

func (*ID) XXX_Unmarshal

func (m *ID) XXX_Unmarshal(b []byte) error

type UnimplementedChatServer

type UnimplementedChatServer struct {
}

UnimplementedChatServer can be embedded to have forward compatible implementations.

func (*UnimplementedChatServer) Receive

func (*UnimplementedChatServer) Receive(req *ID, srv Chat_ReceiveServer) error

func (*UnimplementedChatServer) Send

func (*UnimplementedChatServer) Who

Jump to

Keyboard shortcuts

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