index

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package index is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Pattern_IndexService_HomePage_0 = pattern_IndexService_HomePage_0
	Pattern_IndexService_HomePage_1 = pattern_IndexService_HomePage_1
)

export some private fields

View Source
var File_index_proto protoreflect.FileDescriptor
View Source
var IndexService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sole.api.v1.index.IndexService",
	HandlerType: (*IndexServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "HomePage",
			Handler:    _IndexService_HomePage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "index.proto",
}

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

Functions

func RegisterIndexServiceHandler

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

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

func RegisterIndexServiceHandlerClient

func RegisterIndexServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IndexServiceClient) error

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

func RegisterIndexServiceHandlerFromEndpoint

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

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

func RegisterIndexServiceHandlerServer

func RegisterIndexServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IndexServiceServer) error

RegisterIndexServiceHandlerServer registers the http handlers for service IndexService to "mux". UnaryRPC :call IndexServiceServer 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 RegisterIndexServiceHandlerFromEndpoint instead.

func RegisterIndexServiceServer

func RegisterIndexServiceServer(s grpc.ServiceRegistrar, srv IndexServiceServer)

Types

type IndexServiceClient

type IndexServiceClient interface {
	// 主页
	HomePage(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
}

IndexServiceClient is the client API for IndexService 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 IndexServiceServer

type IndexServiceServer interface {
	// 主页
	HomePage(context.Context, *emptypb.Empty) (*httpbody.HttpBody, error)
	// contains filtered or unexported methods
}

IndexServiceServer is the server API for IndexService service. All implementations must embed UnimplementedIndexServiceServer for forward compatibility

type UnimplementedIndexServiceServer

type UnimplementedIndexServiceServer struct {
}

UnimplementedIndexServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedIndexServiceServer) HomePage

type UnsafeIndexServiceServer

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

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

Jump to

Keyboard shortcuts

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