chat

package
v0.0.0-...-dc85c0f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 5 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 {
	Say(ctx context.Context, in *Text, opts ...grpc.CallOption) (*Confirm, error)
	Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Confirm, error)
	Users(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*UserList, error)
	Channel(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (Chat_ChannelClient, 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 {
	Say(context.Context, *Text) (*Confirm, error)
	Version(context.Context, *Empty) (*Confirm, error)
	Users(context.Context, *Empty) (*UserList, error)
	Channel(*ConnectRequest, Chat_ChannelServer) error
}

ChatServer is the server API for Chat service.

type Chat_ChannelClient

type Chat_ChannelClient interface {
	Recv() (*Text, error)
	grpc.ClientStream
}

type Chat_ChannelServer

type Chat_ChannelServer interface {
	Send(*Text) error
	grpc.ServerStream
}

type Confirm

type Confirm struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Error                bool     `protobuf:"varint,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Confirm) Descriptor

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

func (*Confirm) GetError

func (m *Confirm) GetError() bool

func (*Confirm) GetMessage

func (m *Confirm) GetMessage() string

func (*Confirm) ProtoMessage

func (*Confirm) ProtoMessage()

func (*Confirm) Reset

func (m *Confirm) Reset()

func (*Confirm) String

func (m *Confirm) String() string

func (*Confirm) XXX_DiscardUnknown

func (m *Confirm) XXX_DiscardUnknown()

func (*Confirm) XXX_Marshal

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

func (*Confirm) XXX_Merge

func (dst *Confirm) XXX_Merge(src proto.Message)

func (*Confirm) XXX_Size

func (m *Confirm) XXX_Size() int

func (*Confirm) XXX_Unmarshal

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

type ConnectRequest

type ConnectRequest struct {
	Username             string   `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ConnectRequest) Descriptor

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

func (*ConnectRequest) GetUsername

func (m *ConnectRequest) GetUsername() string

func (*ConnectRequest) ProtoMessage

func (*ConnectRequest) ProtoMessage()

func (*ConnectRequest) Reset

func (m *ConnectRequest) Reset()

func (*ConnectRequest) String

func (m *ConnectRequest) String() string

func (*ConnectRequest) XXX_DiscardUnknown

func (m *ConnectRequest) XXX_DiscardUnknown()

func (*ConnectRequest) XXX_Marshal

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

func (*ConnectRequest) XXX_Merge

func (dst *ConnectRequest) XXX_Merge(src proto.Message)

func (*ConnectRequest) XXX_Size

func (m *ConnectRequest) XXX_Size() int

func (*ConnectRequest) XXX_Unmarshal

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

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

func (dst *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type Text

type Text struct {
	Username             string   `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Text) Descriptor

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

func (*Text) GetMessage

func (m *Text) GetMessage() string

func (*Text) GetUsername

func (m *Text) GetUsername() string

func (*Text) ProtoMessage

func (*Text) ProtoMessage()

func (*Text) Reset

func (m *Text) Reset()

func (*Text) String

func (m *Text) String() string

func (*Text) XXX_DiscardUnknown

func (m *Text) XXX_DiscardUnknown()

func (*Text) XXX_Marshal

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

func (*Text) XXX_Merge

func (dst *Text) XXX_Merge(src proto.Message)

func (*Text) XXX_Size

func (m *Text) XXX_Size() int

func (*Text) XXX_Unmarshal

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

type User

type User struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

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

func (*User) GetName

func (m *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

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

func (*User) XXX_Merge

func (dst *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

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

type UserList

type UserList struct {
	Users                []*User  `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UserList) Descriptor

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

func (*UserList) GetUsers

func (m *UserList) GetUsers() []*User

func (*UserList) ProtoMessage

func (*UserList) ProtoMessage()

func (*UserList) Reset

func (m *UserList) Reset()

func (*UserList) String

func (m *UserList) String() string

func (*UserList) XXX_DiscardUnknown

func (m *UserList) XXX_DiscardUnknown()

func (*UserList) XXX_Marshal

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

func (*UserList) XXX_Merge

func (dst *UserList) XXX_Merge(src proto.Message)

func (*UserList) XXX_Size

func (m *UserList) XXX_Size() int

func (*UserList) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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