helper

package
v0.0.0-...-fe5d25b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package helper is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	STHelper_AnalyzeFinancialData_FullMethodName   = "/helper.STHelper/AnalyzeFinancialData"
	STHelper_GetStockQuote_FullMethodName          = "/helper.STHelper/GetStockQuote"
	STHelper_GetHistoricalStockData_FullMethodName = "/helper.STHelper/GetHistoricalStockData"
)

Variables

View Source
var File_helper_helper_proto protoreflect.FileDescriptor
View Source
var STHelper_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "helper.STHelper",
	HandlerType: (*STHelperServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AnalyzeFinancialData",
			Handler:    _STHelper_AnalyzeFinancialData_Handler,
		},
		{
			MethodName: "GetStockQuote",
			Handler:    _STHelper_GetStockQuote_Handler,
		},
		{
			MethodName: "GetHistoricalStockData",
			Handler:    _STHelper_GetHistoricalStockData_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "helper/helper.proto",
}

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

Functions

func RegisterSTHelperHandler

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

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

func RegisterSTHelperHandlerClient

func RegisterSTHelperHandlerClient(ctx context.Context, mux *runtime.ServeMux, client STHelperClient) error

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

func RegisterSTHelperHandlerFromEndpoint

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

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

func RegisterSTHelperHandlerServer

func RegisterSTHelperHandlerServer(ctx context.Context, mux *runtime.ServeMux, server STHelperServer) error

RegisterSTHelperHandlerServer registers the http handlers for service STHelper to "mux". UnaryRPC :call STHelperServer 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 RegisterSTHelperHandlerFromEndpoint instead.

func RegisterSTHelperServer

func RegisterSTHelperServer(s grpc.ServiceRegistrar, srv STHelperServer)

Types

type FinancialRequest

type FinancialRequest struct {
	UserId        string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
	FinancialData string `protobuf:"bytes,2,opt,name=financial_data,json=financialData,proto3" json:"financial_data,omitempty"`
	// contains filtered or unexported fields
}

func (*FinancialRequest) Descriptor deprecated

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

Deprecated: Use FinancialRequest.ProtoReflect.Descriptor instead.

func (*FinancialRequest) GetFinancialData

func (x *FinancialRequest) GetFinancialData() string

func (*FinancialRequest) GetUserId

func (x *FinancialRequest) GetUserId() string

func (*FinancialRequest) ProtoMessage

func (*FinancialRequest) ProtoMessage()

func (*FinancialRequest) ProtoReflect

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

func (*FinancialRequest) Reset

func (x *FinancialRequest) Reset()

func (*FinancialRequest) String

func (x *FinancialRequest) String() string

type FinancialResponse

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

func (*FinancialResponse) Descriptor deprecated

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

Deprecated: Use FinancialResponse.ProtoReflect.Descriptor instead.

func (*FinancialResponse) GetSuggestions

func (x *FinancialResponse) GetSuggestions() string

func (*FinancialResponse) ProtoMessage

func (*FinancialResponse) ProtoMessage()

func (*FinancialResponse) ProtoReflect

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

func (*FinancialResponse) Reset

func (x *FinancialResponse) Reset()

func (*FinancialResponse) String

func (x *FinancialResponse) String() string

type HistoricalStockDataRequest

type HistoricalStockDataRequest struct {
	Symbol    string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	StartDate string `protobuf:"bytes,2,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"`
	EndDate   string `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"`
	Provider  string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"`
	// contains filtered or unexported fields
}

func (*HistoricalStockDataRequest) Descriptor deprecated

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

Deprecated: Use HistoricalStockDataRequest.ProtoReflect.Descriptor instead.

func (*HistoricalStockDataRequest) GetEndDate

func (x *HistoricalStockDataRequest) GetEndDate() string

func (*HistoricalStockDataRequest) GetProvider

func (x *HistoricalStockDataRequest) GetProvider() string

func (*HistoricalStockDataRequest) GetStartDate

func (x *HistoricalStockDataRequest) GetStartDate() string

func (*HistoricalStockDataRequest) GetSymbol

func (x *HistoricalStockDataRequest) GetSymbol() string

func (*HistoricalStockDataRequest) ProtoMessage

func (*HistoricalStockDataRequest) ProtoMessage()

func (*HistoricalStockDataRequest) ProtoReflect

func (*HistoricalStockDataRequest) Reset

func (x *HistoricalStockDataRequest) Reset()

func (*HistoricalStockDataRequest) String

func (x *HistoricalStockDataRequest) String() string

type HistoricalStockDataResponse

type HistoricalStockDataResponse struct {
	Open             []float32 `protobuf:"fixed32,1,rep,packed,name=open,proto3" json:"open,omitempty"`
	High             []float32 `protobuf:"fixed32,2,rep,packed,name=high,proto3" json:"high,omitempty"`
	Low              []float32 `protobuf:"fixed32,3,rep,packed,name=low,proto3" json:"low,omitempty"`
	Close            []float32 `protobuf:"fixed32,4,rep,packed,name=close,proto3" json:"close,omitempty"`
	Volume           []int64   `protobuf:"varint,5,rep,packed,name=volume,proto3" json:"volume,omitempty"`
	Vwap             []float32 `protobuf:"fixed32,6,rep,packed,name=vwap,proto3" json:"vwap,omitempty"`
	AdjClose         []float32 `protobuf:"fixed32,7,rep,packed,name=adj_close,json=adjClose,proto3" json:"adj_close,omitempty"`
	UnadjustedVolume []float32 `protobuf:"fixed32,8,rep,packed,name=unadjusted_volume,json=unadjustedVolume,proto3" json:"unadjusted_volume,omitempty"`
	Change           []float32 `protobuf:"fixed32,9,rep,packed,name=change,proto3" json:"change,omitempty"`
	ChangePercent    []float32 `protobuf:"fixed32,10,rep,packed,name=change_percent,json=changePercent,proto3" json:"change_percent,omitempty"`
	// contains filtered or unexported fields
}

func (*HistoricalStockDataResponse) Descriptor deprecated

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

Deprecated: Use HistoricalStockDataResponse.ProtoReflect.Descriptor instead.

func (*HistoricalStockDataResponse) GetAdjClose

func (x *HistoricalStockDataResponse) GetAdjClose() []float32

func (*HistoricalStockDataResponse) GetChange

func (x *HistoricalStockDataResponse) GetChange() []float32

func (*HistoricalStockDataResponse) GetChangePercent

func (x *HistoricalStockDataResponse) GetChangePercent() []float32

func (*HistoricalStockDataResponse) GetClose

func (x *HistoricalStockDataResponse) GetClose() []float32

func (*HistoricalStockDataResponse) GetHigh

func (x *HistoricalStockDataResponse) GetHigh() []float32

func (*HistoricalStockDataResponse) GetLow

func (x *HistoricalStockDataResponse) GetLow() []float32

func (*HistoricalStockDataResponse) GetOpen

func (x *HistoricalStockDataResponse) GetOpen() []float32

func (*HistoricalStockDataResponse) GetUnadjustedVolume

func (x *HistoricalStockDataResponse) GetUnadjustedVolume() []float32

func (*HistoricalStockDataResponse) GetVolume

func (x *HistoricalStockDataResponse) GetVolume() []int64

func (*HistoricalStockDataResponse) GetVwap

func (x *HistoricalStockDataResponse) GetVwap() []float32

func (*HistoricalStockDataResponse) ProtoMessage

func (*HistoricalStockDataResponse) ProtoMessage()

func (*HistoricalStockDataResponse) ProtoReflect

func (*HistoricalStockDataResponse) Reset

func (x *HistoricalStockDataResponse) Reset()

func (*HistoricalStockDataResponse) String

func (x *HistoricalStockDataResponse) String() string

type STHelperClient

type STHelperClient interface {
	AnalyzeFinancialData(ctx context.Context, in *FinancialRequest, opts ...grpc.CallOption) (*FinancialResponse, error)
	GetStockQuote(ctx context.Context, in *StockQuoteRequest, opts ...grpc.CallOption) (*StockQuoteResponse, error)
	GetHistoricalStockData(ctx context.Context, in *HistoricalStockDataRequest, opts ...grpc.CallOption) (*HistoricalStockDataResponse, error)
}

STHelperClient is the client API for STHelper 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 NewSTHelperClient

func NewSTHelperClient(cc grpc.ClientConnInterface) STHelperClient

type STHelperServer

type STHelperServer interface {
	AnalyzeFinancialData(context.Context, *FinancialRequest) (*FinancialResponse, error)
	GetStockQuote(context.Context, *StockQuoteRequest) (*StockQuoteResponse, error)
	GetHistoricalStockData(context.Context, *HistoricalStockDataRequest) (*HistoricalStockDataResponse, error)
	// contains filtered or unexported methods
}

STHelperServer is the server API for STHelper service. All implementations must embed UnimplementedSTHelperServer for forward compatibility

type StockQuoteRequest

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

func (*StockQuoteRequest) Descriptor deprecated

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

Deprecated: Use StockQuoteRequest.ProtoReflect.Descriptor instead.

func (*StockQuoteRequest) GetProvider

func (x *StockQuoteRequest) GetProvider() string

func (*StockQuoteRequest) GetSymbol

func (x *StockQuoteRequest) GetSymbol() string

func (*StockQuoteRequest) ProtoMessage

func (*StockQuoteRequest) ProtoMessage()

func (*StockQuoteRequest) ProtoReflect

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

func (*StockQuoteRequest) Reset

func (x *StockQuoteRequest) Reset()

func (*StockQuoteRequest) String

func (x *StockQuoteRequest) String() string

type StockQuoteResponse

type StockQuoteResponse struct {
	Symbol               string  `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	Name                 string  `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Exchange             string  `protobuf:"bytes,3,opt,name=exchange,proto3" json:"exchange,omitempty"`
	LastPrice            float32 `protobuf:"fixed32,4,opt,name=lastPrice,proto3" json:"lastPrice,omitempty"`
	Open                 float32 `protobuf:"fixed32,5,opt,name=open,proto3" json:"open,omitempty"`
	High                 float32 `protobuf:"fixed32,6,opt,name=high,proto3" json:"high,omitempty"`
	Low                  float32 `protobuf:"fixed32,7,opt,name=low,proto3" json:"low,omitempty"`
	Volume               int64   `protobuf:"varint,8,opt,name=volume,proto3" json:"volume,omitempty"`
	PrevClose            float32 `protobuf:"fixed32,9,opt,name=prevClose,proto3" json:"prevClose,omitempty"`
	Change               float32 `protobuf:"fixed32,10,opt,name=change,proto3" json:"change,omitempty"`
	ChangePercent        float32 `protobuf:"fixed32,11,opt,name=changePercent,proto3" json:"changePercent,omitempty"`
	YearHigh             float32 `protobuf:"fixed32,12,opt,name=yearHigh,proto3" json:"yearHigh,omitempty"`
	YearLow              float32 `protobuf:"fixed32,13,opt,name=yearLow,proto3" json:"yearLow,omitempty"`
	MarketCap            int64   `protobuf:"varint,14,opt,name=marketCap,proto3" json:"marketCap,omitempty"`
	SharesOutstanding    int64   `protobuf:"varint,15,opt,name=sharesOutstanding,proto3" json:"sharesOutstanding,omitempty"`
	Pe                   float32 `protobuf:"fixed32,16,opt,name=pe,proto3" json:"pe,omitempty"`
	EarningsAnnouncement string  `protobuf:"bytes,17,opt,name=earningsAnnouncement,proto3" json:"earningsAnnouncement,omitempty"`
	Eps                  float32 `protobuf:"fixed32,18,opt,name=eps,proto3" json:"eps,omitempty"`
	Sector               string  `protobuf:"bytes,19,opt,name=sector,proto3" json:"sector,omitempty"`
	Industry             string  `protobuf:"bytes,20,opt,name=industry,proto3" json:"industry,omitempty"`
	Beta                 float32 `protobuf:"fixed32,21,opt,name=beta,proto3" json:"beta,omitempty"`
	// contains filtered or unexported fields
}

func (*StockQuoteResponse) Descriptor deprecated

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

Deprecated: Use StockQuoteResponse.ProtoReflect.Descriptor instead.

func (*StockQuoteResponse) GetBeta

func (x *StockQuoteResponse) GetBeta() float32

func (*StockQuoteResponse) GetChange

func (x *StockQuoteResponse) GetChange() float32

func (*StockQuoteResponse) GetChangePercent

func (x *StockQuoteResponse) GetChangePercent() float32

func (*StockQuoteResponse) GetEarningsAnnouncement

func (x *StockQuoteResponse) GetEarningsAnnouncement() string

func (*StockQuoteResponse) GetEps

func (x *StockQuoteResponse) GetEps() float32

func (*StockQuoteResponse) GetExchange

func (x *StockQuoteResponse) GetExchange() string

func (*StockQuoteResponse) GetHigh

func (x *StockQuoteResponse) GetHigh() float32

func (*StockQuoteResponse) GetIndustry

func (x *StockQuoteResponse) GetIndustry() string

func (*StockQuoteResponse) GetLastPrice

func (x *StockQuoteResponse) GetLastPrice() float32

func (*StockQuoteResponse) GetLow

func (x *StockQuoteResponse) GetLow() float32

func (*StockQuoteResponse) GetMarketCap

func (x *StockQuoteResponse) GetMarketCap() int64

func (*StockQuoteResponse) GetName

func (x *StockQuoteResponse) GetName() string

func (*StockQuoteResponse) GetOpen

func (x *StockQuoteResponse) GetOpen() float32

func (*StockQuoteResponse) GetPe

func (x *StockQuoteResponse) GetPe() float32

func (*StockQuoteResponse) GetPrevClose

func (x *StockQuoteResponse) GetPrevClose() float32

func (*StockQuoteResponse) GetSector

func (x *StockQuoteResponse) GetSector() string

func (*StockQuoteResponse) GetSharesOutstanding

func (x *StockQuoteResponse) GetSharesOutstanding() int64

func (*StockQuoteResponse) GetSymbol

func (x *StockQuoteResponse) GetSymbol() string

func (*StockQuoteResponse) GetVolume

func (x *StockQuoteResponse) GetVolume() int64

func (*StockQuoteResponse) GetYearHigh

func (x *StockQuoteResponse) GetYearHigh() float32

func (*StockQuoteResponse) GetYearLow

func (x *StockQuoteResponse) GetYearLow() float32

func (*StockQuoteResponse) ProtoMessage

func (*StockQuoteResponse) ProtoMessage()

func (*StockQuoteResponse) ProtoReflect

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

func (*StockQuoteResponse) Reset

func (x *StockQuoteResponse) Reset()

func (*StockQuoteResponse) String

func (x *StockQuoteResponse) String() string

type UnimplementedSTHelperServer

type UnimplementedSTHelperServer struct {
}

UnimplementedSTHelperServer must be embedded to have forward compatible implementations.

func (UnimplementedSTHelperServer) AnalyzeFinancialData

func (UnimplementedSTHelperServer) GetStockQuote

type UnsafeSTHelperServer

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

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

Jump to

Keyboard shortcuts

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