devrpc

package
v0.15.5-beta Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package devrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Dev_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "devrpc.Dev",
	HandlerType: (*DevServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ImportGraph",
			Handler:    _Dev_ImportGraph_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "devrpc/dev.proto",
}

Dev_ServiceDesc is the grpc.ServiceDesc for Dev 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_devrpc_dev_proto protoreflect.FileDescriptor

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by by default until UseLogger is called.

func RegisterDevHandler

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

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

func RegisterDevHandlerClient

func RegisterDevHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DevClient) error

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

func RegisterDevHandlerFromEndpoint

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

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

func RegisterDevHandlerServer

func RegisterDevHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DevServer) error

RegisterDevHandlerServer registers the http handlers for service Dev to "mux". UnaryRPC :call DevServer 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 RegisterDevHandlerFromEndpoint instead.

func RegisterDevJSONCallbacks

func RegisterDevJSONCallbacks(registry map[string]func(ctx context.Context,
	conn *grpc.ClientConn, reqJSON string, callback func(string, error)))

func RegisterDevServer

func RegisterDevServer(s grpc.ServiceRegistrar, srv DevServer)

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type Config

type Config struct{}

Config is empty for non-devrpc builds.

type DevClient

type DevClient interface {
	//
	//ImportGraph imports a ChannelGraph into the graph database. Should only be
	//used for development.
	ImportGraph(ctx context.Context, in *lnrpc.ChannelGraph, opts ...grpc.CallOption) (*ImportGraphResponse, error)
}

DevClient is the client API for Dev 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.

func NewDevClient

func NewDevClient(cc grpc.ClientConnInterface) DevClient

type DevServer

type DevServer interface {
	//
	//ImportGraph imports a ChannelGraph into the graph database. Should only be
	//used for development.
	ImportGraph(context.Context, *lnrpc.ChannelGraph) (*ImportGraphResponse, error)
	// contains filtered or unexported methods
}

DevServer is the server API for Dev service. All implementations must embed UnimplementedDevServer for forward compatibility

type ImportGraphResponse

type ImportGraphResponse struct {
	// contains filtered or unexported fields
}

func (*ImportGraphResponse) Descriptor deprecated

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

Deprecated: Use ImportGraphResponse.ProtoReflect.Descriptor instead.

func (*ImportGraphResponse) ProtoMessage

func (*ImportGraphResponse) ProtoMessage()

func (*ImportGraphResponse) ProtoReflect

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

func (*ImportGraphResponse) Reset

func (x *ImportGraphResponse) Reset()

func (*ImportGraphResponse) String

func (x *ImportGraphResponse) String() string

type UnimplementedDevServer

type UnimplementedDevServer struct {
}

UnimplementedDevServer must be embedded to have forward compatible implementations.

func (UnimplementedDevServer) ImportGraph

type UnsafeDevServer

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

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

Jump to

Keyboard shortcuts

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