pricesrpc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package pricesrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_prices_proto protoreflect.FileDescriptor
View Source
var Prices_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pricesrpc.Prices",
	HandlerType: (*PricesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPrice",
			Handler:    _Prices_GetPrice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "prices.proto",
}

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

Functions

func RegisterPricesHandler

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

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

func RegisterPricesHandlerClient

func RegisterPricesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricesClient) error

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

func RegisterPricesHandlerFromEndpoint

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

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

func RegisterPricesHandlerServer

func RegisterPricesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricesServer) error

RegisterPricesHandlerServer registers the http handlers for service Prices to "mux". UnaryRPC :call PricesServer 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 RegisterPricesHandlerFromEndpoint instead.

func RegisterPricesServer

func RegisterPricesServer(s grpc.ServiceRegistrar, srv PricesServer)

Types

type GetPriceRequest

type GetPriceRequest struct {
	Path            string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	HttpRequestText string `protobuf:"bytes,2,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceRequest) Descriptor deprecated

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

Deprecated: Use GetPriceRequest.ProtoReflect.Descriptor instead.

func (*GetPriceRequest) GetHttpRequestText

func (x *GetPriceRequest) GetHttpRequestText() string

func (*GetPriceRequest) GetPath

func (x *GetPriceRequest) GetPath() string

func (*GetPriceRequest) ProtoMessage

func (*GetPriceRequest) ProtoMessage()

func (*GetPriceRequest) ProtoReflect

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

func (*GetPriceRequest) Reset

func (x *GetPriceRequest) Reset()

func (*GetPriceRequest) String

func (x *GetPriceRequest) String() string

type GetPriceResponse

type GetPriceResponse struct {
	PriceSats int64 `protobuf:"varint,1,opt,name=price_sats,json=priceSats,proto3" json:"price_sats,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceResponse) Descriptor deprecated

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

Deprecated: Use GetPriceResponse.ProtoReflect.Descriptor instead.

func (*GetPriceResponse) GetPriceSats

func (x *GetPriceResponse) GetPriceSats() int64

func (*GetPriceResponse) ProtoMessage

func (*GetPriceResponse) ProtoMessage()

func (*GetPriceResponse) ProtoReflect

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

func (*GetPriceResponse) Reset

func (x *GetPriceResponse) Reset()

func (*GetPriceResponse) String

func (x *GetPriceResponse) String() string

type PricesClient

type PricesClient interface {
	GetPrice(ctx context.Context, in *GetPriceRequest, opts ...grpc.CallOption) (*GetPriceResponse, error)
}

PricesClient is the client API for Prices 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 NewPricesClient

func NewPricesClient(cc grpc.ClientConnInterface) PricesClient

type PricesServer

type PricesServer interface {
	GetPrice(context.Context, *GetPriceRequest) (*GetPriceResponse, error)
	// contains filtered or unexported methods
}

PricesServer is the server API for Prices service. All implementations must embed UnimplementedPricesServer for forward compatibility

type UnimplementedPricesServer

type UnimplementedPricesServer struct {
}

UnimplementedPricesServer must be embedded to have forward compatible implementations.

func (UnimplementedPricesServer) GetPrice

type UnsafePricesServer

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

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

Jump to

Keyboard shortcuts

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