example

package
v0.0.0-...-8e43c1e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package example is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_example_proto protoreflect.FileDescriptor

Functions

func RegisterModelTrainerServiceHandler

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

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

func RegisterModelTrainerServiceHandlerClient

func RegisterModelTrainerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelTrainerServiceClient) error

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

func RegisterModelTrainerServiceHandlerFromEndpoint

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

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

func RegisterModelTrainerServiceHandlerServer

func RegisterModelTrainerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelTrainerServiceServer) error

RegisterModelTrainerServiceHandlerServer registers the http handlers for service ModelTrainerService to "mux". UnaryRPC :call ModelTrainerServiceServer 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 RegisterModelTrainerServiceHandlerFromEndpoint instead.

func RegisterModelTrainerServiceServer

func RegisterModelTrainerServiceServer(s *grpc.Server, srv ModelTrainerServiceServer)

func RegisterScraperServiceHandler

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

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

func RegisterScraperServiceHandlerClient

func RegisterScraperServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ScraperServiceClient) error

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

func RegisterScraperServiceHandlerFromEndpoint

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

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

func RegisterScraperServiceHandlerServer

func RegisterScraperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ScraperServiceServer) error

RegisterScraperServiceHandlerServer registers the http handlers for service ScraperService to "mux". UnaryRPC :call ScraperServiceServer 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 RegisterScraperServiceHandlerFromEndpoint instead.

func RegisterScraperServiceServer

func RegisterScraperServiceServer(s *grpc.Server, srv ScraperServiceServer)

Types

type ModelTrainerServiceClient

type ModelTrainerServiceClient interface {
	// get running trainers
	GetTrainers(ctx context.Context, in *GetTrainersRequest, opts ...grpc.CallOption) (*GetTrainersResponse, error)
	// start a new trainer
	StartTrainer(ctx context.Context, in *StartTrainerRequest, opts ...grpc.CallOption) (*StartTrainerResponse, error)
}

ModelTrainerServiceClient is the client API for ModelTrainerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ModelTrainerServiceServer

type ModelTrainerServiceServer interface {
	// get running trainers
	GetTrainers(context.Context, *GetTrainersRequest) (*GetTrainersResponse, error)
	// start a new trainer
	StartTrainer(context.Context, *StartTrainerRequest) (*StartTrainerResponse, error)
}

ModelTrainerServiceServer is the server API for ModelTrainerService service.

type ScraperServiceClient

type ScraperServiceClient interface {
	GetBasicInfo(ctx context.Context, in *GetBasicInfoRequest, opts ...grpc.CallOption) (*GetBasicInfoResponse, error)
}

ScraperServiceClient is the client API for ScraperService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ScraperServiceServer

type ScraperServiceServer interface {
	GetBasicInfo(context.Context, *GetBasicInfoRequest) (*GetBasicInfoResponse, error)
}

ScraperServiceServer is the server API for ScraperService service.

type UnimplementedModelTrainerServiceServer

type UnimplementedModelTrainerServiceServer struct {
}

UnimplementedModelTrainerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedModelTrainerServiceServer) GetTrainers

func (*UnimplementedModelTrainerServiceServer) GetTrainers(context.Context, *GetTrainersRequest) (*GetTrainersResponse, error)

func (*UnimplementedModelTrainerServiceServer) StartTrainer

func (*UnimplementedModelTrainerServiceServer) StartTrainer(context.Context, *StartTrainerRequest) (*StartTrainerResponse, error)

type UnimplementedScraperServiceServer

type UnimplementedScraperServiceServer struct {
}

UnimplementedScraperServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedScraperServiceServer) GetBasicInfo

func (*UnimplementedScraperServiceServer) GetBasicInfo(context.Context, *GetBasicInfoRequest) (*GetBasicInfoResponse, error)

Jump to

Keyboard shortcuts

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