api

package
v0.0.0-...-1e5e981 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoChat_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.GoChat",
	HandlerType: (*GoChatServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Chat",
			Handler:    _GoChat_Chat_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api.proto",
}

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

Functions

func RegisterGoChatServer

func RegisterGoChatServer(s grpc.ServiceRegistrar, srv GoChatServer)

Types

type ChatRequest

type ChatRequest struct {
	From    *Handle `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	To      *Handle `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	Message string  `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatRequest) Descriptor deprecated

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

Deprecated: Use ChatRequest.ProtoReflect.Descriptor instead.

func (*ChatRequest) GetFrom

func (x *ChatRequest) GetFrom() *Handle

func (*ChatRequest) GetMessage

func (x *ChatRequest) GetMessage() string

func (*ChatRequest) GetTo

func (x *ChatRequest) GetTo() *Handle

func (*ChatRequest) ProtoMessage

func (*ChatRequest) ProtoMessage()

func (*ChatRequest) ProtoReflect

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

func (*ChatRequest) Reset

func (x *ChatRequest) Reset()

func (*ChatRequest) String

func (x *ChatRequest) String() string

type ChatResponse

type ChatResponse struct {
	NotFound bool `protobuf:"varint,1,opt,name=not_found,json=notFound,proto3" json:"not_found,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatResponse) Descriptor deprecated

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

Deprecated: Use ChatResponse.ProtoReflect.Descriptor instead.

func (*ChatResponse) GetNotFound

func (x *ChatResponse) GetNotFound() bool

func (*ChatResponse) ProtoMessage

func (*ChatResponse) ProtoMessage()

func (*ChatResponse) ProtoReflect

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

func (*ChatResponse) Reset

func (x *ChatResponse) Reset()

func (*ChatResponse) String

func (x *ChatResponse) String() string

type GoChatClient

type GoChatClient interface {
	Chat(ctx context.Context, in *ChatRequest, opts ...grpc.CallOption) (*ChatResponse, error)
}

GoChatClient is the client API for GoChat 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 NewGoChatClient

func NewGoChatClient(cc grpc.ClientConnInterface) GoChatClient

type GoChatServer

type GoChatServer interface {
	Chat(context.Context, *ChatRequest) (*ChatResponse, error)
	// contains filtered or unexported methods
}

GoChatServer is the server API for GoChat service. All implementations must embed UnimplementedGoChatServer for forward compatibility

type Handle

type Handle struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	Port int32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	// contains filtered or unexported fields
}

func (*Handle) Descriptor deprecated

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

Deprecated: Use Handle.ProtoReflect.Descriptor instead.

func (*Handle) GetHost

func (x *Handle) GetHost() string

func (*Handle) GetName

func (x *Handle) GetName() string

func (*Handle) GetPort

func (x *Handle) GetPort() int32

func (*Handle) ProtoMessage

func (*Handle) ProtoMessage()

func (*Handle) ProtoReflect

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

func (*Handle) Reset

func (x *Handle) Reset()

func (*Handle) String

func (x *Handle) String() string

type UnimplementedGoChatServer

type UnimplementedGoChatServer struct {
}

UnimplementedGoChatServer must be embedded to have forward compatible implementations.

func (UnimplementedGoChatServer) Chat

type UnsafeGoChatServer

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

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

Jump to

Keyboard shortcuts

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