service

package
v0.0.0-...-f7a7510 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT-0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EchoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.EchoService",
	HandlerType: (*EchoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _EchoService_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "echo.proto",
}

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

Functions

func RegisterEchoServiceServer

func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)

func RegisterHttpHandler

func RegisterHttpHandler()

register http handler

Types

type EchoServiceClient

type EchoServiceClient interface {
	Echo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

EchoServiceClient is the client API for EchoService 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.

type EchoServiceServer

type EchoServiceServer interface {
	Echo(context.Context, *Request) (*Response, error)
}

EchoServiceServer is the server API for EchoService service. All implementations should embed UnimplementedEchoServiceServer for forward compatibility

type GrpcServer

type GrpcServer struct {
	Host string
	Port int
}

GrpcServer gRPC server

func NewGrpcServer

func NewGrpcServer(host string, port int) (server *GrpcServer, err error)

func (*GrpcServer) Start

func (s *GrpcServer) Start()

type HttpServer

type HttpServer struct {
	Host string
	Port int
}

http server

func NewHttpServer

func NewHttpServer(host string, port int) (server *HttpServer, err error)

new http server

func (*HttpServer) Start

func (s *HttpServer) Start()

start http server

type Request

type Request struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetMessage

func (x *Request) GetMessage() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type TcpServer

type TcpServer struct {
	Host string
	Port int
}

func NewTcpServer

func NewTcpServer(host string, port int) (*TcpServer, error)

func (*TcpServer) Start

func (s *TcpServer) Start()

type UdpServer

type UdpServer struct {
	Host string
	Port int
}

func NewUdpServer

func NewUdpServer(host string, port int) (server *UdpServer, err error)

func (*UdpServer) Start

func (s *UdpServer) Start()

type UnimplementedEchoServiceServer

type UnimplementedEchoServiceServer struct {
}

UnimplementedEchoServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedEchoServiceServer) Echo

type UnsafeEchoServiceServer

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

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

type WebSocketServer

type WebSocketServer struct {
	Host string
	Port int
}

websocket server

func NewWebSocketServer

func NewWebSocketServer(host string, port int) (server *WebSocketServer, err error)

new websocket server

func (*WebSocketServer) Start

func (s *WebSocketServer) Start() (err error)

start websocket server

Jump to

Keyboard shortcuts

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