services

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

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

Go to latest
Published: Oct 14, 2020 License: GPL-2.0 Imports: 17 Imported by: 3

Documentation

Overview

Package services is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_daemon_grpc_services_daemon_proto protoreflect.FileDescriptor

Functions

func RegisterDaemonHandler

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

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

func RegisterDaemonHandlerClient

func RegisterDaemonHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DaemonClient) error

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

func RegisterDaemonHandlerFromEndpoint

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

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

func RegisterDaemonHandlerServer

func RegisterDaemonHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DaemonServer) error

RegisterDaemonHandlerServer registers the http handlers for service Daemon to "mux". UnaryRPC :call DaemonServer 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 RegisterDaemonHandlerFromEndpoint instead.

func RegisterDaemonServer

func RegisterDaemonServer(s *grpc.Server, srv DaemonServer)

Types

type DaemonClient

type DaemonClient interface {
	// Serve rpc call to subscribe server side streaming
	SubscribeNotification(ctx context.Context, in *types.SubscribeNotification, opts ...grpc.CallOption) (Daemon_SubscribeNotificationClient, error)
	// Serve rpc / rest call to health check
	HealthCheck(ctx context.Context, in *types.HealthCheckRequest, opts ...grpc.CallOption) (*types.HealthCheckResponse, error)
}

DaemonClient is the client API for Daemon service.

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

func NewDaemonClient

func NewDaemonClient(cc grpc.ClientConnInterface) DaemonClient

type DaemonServer

type DaemonServer interface {
	// Serve rpc call to subscribe server side streaming
	SubscribeNotification(*types.SubscribeNotification, Daemon_SubscribeNotificationServer) error
	// Serve rpc / rest call to health check
	HealthCheck(context.Context, *types.HealthCheckRequest) (*types.HealthCheckResponse, error)
}

DaemonServer is the server API for Daemon service.

type Daemon_SubscribeNotificationClient

type Daemon_SubscribeNotificationClient interface {
	Recv() (*types.StreamMessage, error)
	grpc.ClientStream
}

type Daemon_SubscribeNotificationServer

type Daemon_SubscribeNotificationServer interface {
	Send(*types.StreamMessage) error
	grpc.ServerStream
}

type UnimplementedDaemonServer

type UnimplementedDaemonServer struct {
}

UnimplementedDaemonServer can be embedded to have forward compatible implementations.

func (*UnimplementedDaemonServer) HealthCheck

Jump to

Keyboard shortcuts

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