Documentation
¶
Index ¶
- Variables
- func NewForexEndpoints() []*api.Endpoint
- func RegisterForexHandler(s server.Server, hdlr ForexHandler, opts ...server.HandlerOption) error
- type ForexHandler
- type ForexService
- type HistoryRequest
- type HistoryResponse
- func (*HistoryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HistoryResponse) GetClose() float64
- func (x *HistoryResponse) GetDate() string
- func (x *HistoryResponse) GetHigh() float64
- func (x *HistoryResponse) GetLow() float64
- func (x *HistoryResponse) GetOpen() float64
- func (x *HistoryResponse) GetSymbol() string
- func (x *HistoryResponse) GetVolume() float64
- func (*HistoryResponse) ProtoMessage()
- func (x *HistoryResponse) ProtoReflect() protoreflect.Message
- func (x *HistoryResponse) Reset()
- func (x *HistoryResponse) String() string
- type PriceRequest
- type PriceResponse
- func (*PriceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PriceResponse) GetPrice() float64
- func (x *PriceResponse) GetSymbol() string
- func (*PriceResponse) ProtoMessage()
- func (x *PriceResponse) ProtoReflect() protoreflect.Message
- func (x *PriceResponse) Reset()
- func (x *PriceResponse) String() string
- type QuoteRequest
- type QuoteResponse
- func (*QuoteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QuoteResponse) GetAskPrice() float64
- func (x *QuoteResponse) GetBidPrice() float64
- func (x *QuoteResponse) GetSymbol() string
- func (x *QuoteResponse) GetTimestamp() string
- func (*QuoteResponse) ProtoMessage()
- func (x *QuoteResponse) ProtoReflect() protoreflect.Message
- func (x *QuoteResponse) Reset()
- func (x *QuoteResponse) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_forex_proto protoreflect.FileDescriptor
Functions ¶
func NewForexEndpoints ¶
func RegisterForexHandler ¶
func RegisterForexHandler(s server.Server, hdlr ForexHandler, opts ...server.HandlerOption) error
Types ¶
type ForexHandler ¶
type ForexHandler interface {
Quote(context.Context, *QuoteRequest, *QuoteResponse) error
Price(context.Context, *PriceRequest, *PriceResponse) error
History(context.Context, *HistoryRequest, *HistoryResponse) error
}
type ForexService ¶
type ForexService 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 NewForexService ¶
func NewForexService(name string, c client.Client) ForexService
type HistoryRequest ¶
type HistoryRequest struct {
// the forex symbol e.g GBPUSD
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
// contains filtered or unexported fields
}
Returns the data for the previous close
func (*HistoryRequest) Descriptor
deprecated
func (*HistoryRequest) Descriptor() ([]byte, []int)
Deprecated: Use HistoryRequest.ProtoReflect.Descriptor instead.
func (*HistoryRequest) GetSymbol ¶
func (x *HistoryRequest) GetSymbol() 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 forex 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 float64 `protobuf:"fixed64,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() float64
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 {
// forex symbol e.g GBPUSD
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
// contains filtered or unexported fields
}
Get the last price for a given forex 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 forex symbol e.g GBPUSD
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 forex symbol e.g GBPUSD
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
// contains filtered or unexported fields
}
Get the last quote for the forex
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 forex 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 UTC timestamp of the quote
Timestamp string `protobuf:"bytes,4,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) GetBidPrice ¶
func (x *QuoteResponse) GetBidPrice() float64
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
Click to show internal directories.
Click to hide internal directories.