stock

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_stock_proto protoreflect.FileDescriptor

Functions

func NewStockEndpoints

func NewStockEndpoints() []*api.Endpoint

func RegisterStockHandler

func RegisterStockHandler(s server.Server, hdlr StockHandler, opts ...server.HandlerOption) error

Types

type HistoryRequest

type HistoryRequest struct {

	// the stock symbol e.g AAPL
	Stock string `protobuf:"bytes,1,opt,name=stock,proto3" json:"stock,omitempty"`
	// date to retrieve as YYYY-MM-DD
	Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`
	// contains filtered or unexported fields
}

Get the historic open-close for a given day

func (*HistoryRequest) Descriptor deprecated

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

Deprecated: Use HistoryRequest.ProtoReflect.Descriptor instead.

func (*HistoryRequest) GetDate

func (x *HistoryRequest) GetDate() string

func (*HistoryRequest) GetStock

func (x *HistoryRequest) GetStock() string

func (*HistoryRequest) ProtoMessage

func (*HistoryRequest) ProtoMessage()

func (*HistoryRequest) ProtoReflect

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

func (*HistoryRequest) Reset

func (x *HistoryRequest) Reset()

func (*HistoryRequest) String

func (x *HistoryRequest) String() string

type HistoryResponse

type HistoryResponse struct {

	// the stock symbol
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the open price
	Open float64 `protobuf:"fixed64,2,opt,name=open,proto3" json:"open,omitempty"`
	// the close price
	Close float64 `protobuf:"fixed64,3,opt,name=close,proto3" json:"close,omitempty"`
	// the peak price
	High float64 `protobuf:"fixed64,4,opt,name=high,proto3" json:"high,omitempty"`
	// the low price
	Low float64 `protobuf:"fixed64,5,opt,name=low,proto3" json:"low,omitempty"`
	// the volume
	Volume int32 `protobuf:"varint,6,opt,name=volume,proto3" json:"volume,omitempty"`
	// the date
	Date string `protobuf:"bytes,7,opt,name=date,proto3" json:"date,omitempty"`
	// contains filtered or unexported fields
}

func (*HistoryResponse) Descriptor deprecated

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

Deprecated: Use HistoryResponse.ProtoReflect.Descriptor instead.

func (*HistoryResponse) GetClose

func (x *HistoryResponse) GetClose() float64

func (*HistoryResponse) GetDate

func (x *HistoryResponse) GetDate() string

func (*HistoryResponse) GetHigh

func (x *HistoryResponse) GetHigh() float64

func (*HistoryResponse) GetLow

func (x *HistoryResponse) GetLow() float64

func (*HistoryResponse) GetOpen

func (x *HistoryResponse) GetOpen() float64

func (*HistoryResponse) GetSymbol

func (x *HistoryResponse) GetSymbol() string

func (*HistoryResponse) GetVolume

func (x *HistoryResponse) GetVolume() int32

func (*HistoryResponse) ProtoMessage

func (*HistoryResponse) ProtoMessage()

func (*HistoryResponse) ProtoReflect

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

func (*HistoryResponse) Reset

func (x *HistoryResponse) Reset()

func (*HistoryResponse) String

func (x *HistoryResponse) String() string

type PriceRequest

type PriceRequest struct {

	// stock symbol e.g AAPL
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Get the last price for a given stock ticker

func (*PriceRequest) Descriptor deprecated

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

Deprecated: Use PriceRequest.ProtoReflect.Descriptor instead.

func (*PriceRequest) GetSymbol

func (x *PriceRequest) GetSymbol() string

func (*PriceRequest) ProtoMessage

func (*PriceRequest) ProtoMessage()

func (*PriceRequest) ProtoReflect

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

func (*PriceRequest) Reset

func (x *PriceRequest) Reset()

func (*PriceRequest) String

func (x *PriceRequest) String() string

type PriceResponse

type PriceResponse struct {

	// the stock symbol e.g AAPL
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the last price
	Price float64 `protobuf:"fixed64,2,opt,name=price,proto3" json:"price,omitempty"`
	// contains filtered or unexported fields
}

func (*PriceResponse) Descriptor deprecated

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

Deprecated: Use PriceResponse.ProtoReflect.Descriptor instead.

func (*PriceResponse) GetPrice

func (x *PriceResponse) GetPrice() float64

func (*PriceResponse) GetSymbol

func (x *PriceResponse) GetSymbol() string

func (*PriceResponse) ProtoMessage

func (*PriceResponse) ProtoMessage()

func (*PriceResponse) ProtoReflect

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

func (*PriceResponse) Reset

func (x *PriceResponse) Reset()

func (*PriceResponse) String

func (x *PriceResponse) String() string

type QuoteRequest

type QuoteRequest struct {

	// the stock symbol e.g AAPL
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Get the last quote for the stock

func (*QuoteRequest) Descriptor deprecated

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

Deprecated: Use QuoteRequest.ProtoReflect.Descriptor instead.

func (*QuoteRequest) GetSymbol

func (x *QuoteRequest) GetSymbol() string

func (*QuoteRequest) ProtoMessage

func (*QuoteRequest) ProtoMessage()

func (*QuoteRequest) ProtoReflect

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

func (*QuoteRequest) Reset

func (x *QuoteRequest) Reset()

func (*QuoteRequest) String

func (x *QuoteRequest) String() string

type QuoteResponse

type QuoteResponse struct {

	// the stock symbol
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the asking price
	AskPrice float64 `protobuf:"fixed64,2,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"`
	// the bidding price
	BidPrice float64 `protobuf:"fixed64,3,opt,name=bid_price,json=bidPrice,proto3" json:"bid_price,omitempty"`
	// the ask size
	AskSize int32 `protobuf:"varint,4,opt,name=ask_size,json=askSize,proto3" json:"ask_size,omitempty"`
	// the bid size
	BidSize int32 `protobuf:"varint,5,opt,name=bid_size,json=bidSize,proto3" json:"bid_size,omitempty"`
	// the UTC timestamp of the quote
	Timestamp string `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*QuoteResponse) Descriptor deprecated

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

Deprecated: Use QuoteResponse.ProtoReflect.Descriptor instead.

func (*QuoteResponse) GetAskPrice

func (x *QuoteResponse) GetAskPrice() float64

func (*QuoteResponse) GetAskSize

func (x *QuoteResponse) GetAskSize() int32

func (*QuoteResponse) GetBidPrice

func (x *QuoteResponse) GetBidPrice() float64

func (*QuoteResponse) GetBidSize

func (x *QuoteResponse) GetBidSize() int32

func (*QuoteResponse) GetSymbol

func (x *QuoteResponse) GetSymbol() string

func (*QuoteResponse) GetTimestamp

func (x *QuoteResponse) GetTimestamp() string

func (*QuoteResponse) ProtoMessage

func (*QuoteResponse) ProtoMessage()

func (*QuoteResponse) ProtoReflect

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

func (*QuoteResponse) Reset

func (x *QuoteResponse) Reset()

func (*QuoteResponse) String

func (x *QuoteResponse) String() string

type StockService

type StockService interface {
	Quote(ctx context.Context, in *QuoteRequest, opts ...client.CallOption) (*QuoteResponse, error)
	Price(ctx context.Context, in *PriceRequest, opts ...client.CallOption) (*PriceResponse, error)
	History(ctx context.Context, in *HistoryRequest, opts ...client.CallOption) (*HistoryResponse, error)
}

func NewStockService

func NewStockService(name string, c client.Client) StockService

Jump to

Keyboard shortcuts

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