chat

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

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderPeerID   = "x-peer-id"
	HeaderPeerName = "x-peer-name"
)

Metadata keys.

Variables

This section is empty.

Functions

func RegisterChatServer

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

Types

type ChatClient

type ChatClient interface {
	Stream(ctx context.Context, opts ...grpc.CallOption) (Chat_StreamClient, 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.ClientConn) ChatClient

type ChatServer

type ChatServer interface {
	Stream(Chat_StreamServer) error
}

ChatServer is the server API for Chat service.

type Chat_StreamClient

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

type Chat_StreamServer

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

type Message

type Message struct {
	ID        string               `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
	// Types that are valid to be assigned to Payload:
	//	*Message_Text
	Payload              isMessage_Payload `protobuf_oneof:"Payload"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Message) Descriptor

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

func (*Message) GetID

func (m *Message) GetID() string

func (*Message) GetPayload

func (m *Message) GetPayload() isMessage_Payload

func (*Message) GetText

func (m *Message) GetText() string

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() *timestamp.Timestamp

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

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

func (*Message) XXX_Merge

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

func (*Message) XXX_OneofWrappers

func (*Message) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

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

type Message_Text

type Message_Text struct {
	Text string `protobuf:"bytes,3,opt,name=Text,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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