coingecko_api

package
v0.0.0-...-accc4e5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package coingecko_api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	CoinGeckoAPI_GetPrice_FullMethodName = "/coingecko_api.CoinGeckoAPI/GetPrice"
)

Variables

View Source
var CoinGeckoAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "coingecko_api.CoinGeckoAPI",
	HandlerType: (*CoinGeckoAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPrice",
			Handler:    _CoinGeckoAPI_GetPrice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/coingecko-api/coingecko-api.proto",
}

CoinGeckoAPI_ServiceDesc is the grpc.ServiceDesc for CoinGeckoAPI 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_api_coingecko_api_coingecko_api_proto protoreflect.FileDescriptor

Functions

func RegisterCoinGeckoAPIHandler

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

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

func RegisterCoinGeckoAPIHandlerClient

func RegisterCoinGeckoAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CoinGeckoAPIClient) error

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

func RegisterCoinGeckoAPIHandlerFromEndpoint

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

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

func RegisterCoinGeckoAPIHandlerServer

func RegisterCoinGeckoAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CoinGeckoAPIServer) error

RegisterCoinGeckoAPIHandlerServer registers the http handlers for service CoinGeckoAPI to "mux". UnaryRPC :call CoinGeckoAPIServer 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 RegisterCoinGeckoAPIHandlerFromEndpoint instead.

func RegisterCoinGeckoAPIServer

func RegisterCoinGeckoAPIServer(s grpc.ServiceRegistrar, srv CoinGeckoAPIServer)

Types

type CoinGeckoAPIClient

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

CoinGeckoAPIClient is the client API for CoinGeckoAPI 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 CoinGeckoAPIServer

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

CoinGeckoAPIServer is the server API for CoinGeckoAPI service. All implementations must embed UnimplementedCoinGeckoAPIServer for forward compatibility

type GetPriceRequest

type GetPriceRequest struct {
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceRequest) Descriptor deprecated

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

Deprecated: Use GetPriceRequest.ProtoReflect.Descriptor instead.

func (*GetPriceRequest) GetSymbol

func (x *GetPriceRequest) GetSymbol() 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 {
	PriceUsd float64 `protobuf:"fixed64,1,opt,name=price_usd,json=priceUsd,proto3" json:"price_usd,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceResponse) Descriptor deprecated

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

Deprecated: Use GetPriceResponse.ProtoReflect.Descriptor instead.

func (*GetPriceResponse) GetPriceUsd

func (x *GetPriceResponse) GetPriceUsd() float64

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 UnimplementedCoinGeckoAPIServer

type UnimplementedCoinGeckoAPIServer struct {
}

UnimplementedCoinGeckoAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedCoinGeckoAPIServer) GetPrice

type UnsafeCoinGeckoAPIServer

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

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

Jump to

Keyboard shortcuts

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