demo

package
v0.0.0-...-a156103 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package demo is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	OurTeam_name = map[int32]string{
		0: "junedayday",
		1: "cloud_users",
		2: "qilingping",
	}
	OurTeam_value = map[string]int32{
		"junedayday":  0,
		"cloud_users": 1,
		"qilingping":  2,
	}
)

Enum value maps for OurTeam.

View Source
var DemoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "demo.DemoService",
	HandlerType: (*DemoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _DemoService_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "idl/demo/demo.proto",
}

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

View Source
var File_idl_demo_demo_proto protoreflect.FileDescriptor

Functions

func RegisterDemoServiceHandler

func RegisterDemoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterDemoServiceHandler registers the http handlers for service DemoService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterDemoServiceHandlerClient

func RegisterDemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DemoServiceClient) error

RegisterDemoServiceHandlerClient registers the http handlers for service DemoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DemoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DemoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DemoServiceClient" to call the correct interceptors.

func RegisterDemoServiceHandlerFromEndpoint

func RegisterDemoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterDemoServiceHandlerFromEndpoint is same as RegisterDemoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterDemoServiceHandlerServer

func RegisterDemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DemoServiceServer) error

RegisterDemoServiceHandlerServer registers the http handlers for service DemoService to "mux". UnaryRPC :call DemoServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDemoServiceHandlerFromEndpoint instead.

func RegisterDemoServiceServer

func RegisterDemoServiceServer(s grpc.ServiceRegistrar, srv DemoServiceServer)

Types

type DemoServiceClient

type DemoServiceClient interface {
	// Echo 样例接口
	Echo(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error)
}

DemoServiceClient is the client API for DemoService 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 DemoServiceServer

type DemoServiceServer interface {
	// Echo 样例接口
	Echo(context.Context, *StringMessage) (*StringMessage, error)
	// contains filtered or unexported methods
}

DemoServiceServer is the server API for DemoService service. All implementations must embed UnimplementedDemoServiceServer for forward compatibility

type OurTeam

type OurTeam int32
const (
	// github: Junedayday
	OurTeam_junedayday OurTeam = 0
	// github: cloud-users
	OurTeam_cloud_users OurTeam = 1
	// github: qilingping
	OurTeam_qilingping OurTeam = 2
)

func (OurTeam) Descriptor

func (OurTeam) Descriptor() protoreflect.EnumDescriptor

func (OurTeam) Enum

func (x OurTeam) Enum() *OurTeam

func (OurTeam) EnumDescriptor deprecated

func (OurTeam) EnumDescriptor() ([]byte, []int)

Deprecated: Use OurTeam.Descriptor instead.

func (OurTeam) Number

func (x OurTeam) Number() protoreflect.EnumNumber

func (OurTeam) String

func (x OurTeam) String() string

func (OurTeam) Type

func (OurTeam) Type() protoreflect.EnumType

type StringMessage

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

func (*StringMessage) Descriptor deprecated

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

Deprecated: Use StringMessage.ProtoReflect.Descriptor instead.

func (*StringMessage) GetValue

func (x *StringMessage) GetValue() string

func (*StringMessage) ProtoMessage

func (*StringMessage) ProtoMessage()

func (*StringMessage) ProtoReflect

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

func (*StringMessage) Reset

func (x *StringMessage) Reset()

func (*StringMessage) String

func (x *StringMessage) String() string

type UnimplementedDemoServiceServer

type UnimplementedDemoServiceServer struct {
}

UnimplementedDemoServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDemoServiceServer) Echo

type UnsafeDemoServiceServer

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

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

Jump to

Keyboard shortcuts

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