Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterCtpHTTPServer(s *http.Server, srv CtpHTTPServer)
- func RegisterCtpServer(s grpc.ServiceRegistrar, srv CtpServer)
- type CtpClient
- type CtpHTTPClient
- type CtpHTTPClientImpl
- type CtpHTTPServer
- type CtpServer
- type KlineData
- func (*KlineData) Descriptor() ([]byte, []int)deprecated
- func (x *KlineData) GetClose() float64
- func (x *KlineData) GetHigh() float64
- func (x *KlineData) GetLow() float64
- func (x *KlineData) GetOpen() float64
- func (x *KlineData) GetStart() int64
- func (x *KlineData) GetTurnover() float64
- func (x *KlineData) GetVolume() uint64
- func (*KlineData) ProtoMessage()
- func (x *KlineData) ProtoReflect() protoreflect.Message
- func (x *KlineData) Reset()
- func (x *KlineData) String() string
- type KlineReq
- func (*KlineReq) Descriptor() ([]byte, []int)deprecated
- func (x *KlineReq) GetBin() string
- func (x *KlineReq) GetEnd() int64
- func (x *KlineReq) GetStart() int64
- func (x *KlineReq) GetSymbol() string
- func (*KlineReq) ProtoMessage()
- func (x *KlineReq) ProtoReflect() protoreflect.Message
- func (x *KlineReq) Reset()
- func (x *KlineReq) String() string
- type KlineResp
- type MarketData
- func (*MarketData) Descriptor() ([]byte, []int)deprecated
- func (x *MarketData) GetActionDay() string
- func (x *MarketData) GetAskPrice1() float64
- func (x *MarketData) GetAskPrice2() float64
- func (x *MarketData) GetAskPrice3() float64
- func (x *MarketData) GetAskPrice4() float64
- func (x *MarketData) GetAskPrice5() float64
- func (x *MarketData) GetAskVolume1() int64
- func (x *MarketData) GetAskVolume2() int64
- func (x *MarketData) GetAskVolume3() int64
- func (x *MarketData) GetAskVolume4() int64
- func (x *MarketData) GetAskVolume5() int64
- func (x *MarketData) GetAveragePrice() float64
- func (x *MarketData) GetBidPrice1() float64
- func (x *MarketData) GetBidPrice2() float64
- func (x *MarketData) GetBidPrice3() float64
- func (x *MarketData) GetBidPrice4() float64
- func (x *MarketData) GetBidPrice5() float64
- func (x *MarketData) GetBidVolume1() int64
- func (x *MarketData) GetBidVolume2() int64
- func (x *MarketData) GetBidVolume3() int64
- func (x *MarketData) GetBidVolume4() int64
- func (x *MarketData) GetBidVolume5() int64
- func (x *MarketData) GetClosePrice() float64
- func (x *MarketData) GetCurrDelta() float64
- func (x *MarketData) GetExchangeID() string
- func (x *MarketData) GetExchangeInstID() string
- func (x *MarketData) GetHighestPrice() float64
- func (x *MarketData) GetInstrumentID() string
- func (x *MarketData) GetLastPrice() float64
- func (x *MarketData) GetLowerLimitPrice() float64
- func (x *MarketData) GetLowestPrice() float64
- func (x *MarketData) GetOpenInterest() float64
- func (x *MarketData) GetOpenPrice() float64
- func (x *MarketData) GetPreClosePrice() float64
- func (x *MarketData) GetPreDelta() float64
- func (x *MarketData) GetPreOpenInterest() float64
- func (x *MarketData) GetPreSettlementPrice() float64
- func (x *MarketData) GetSettlementPrice() float64
- func (x *MarketData) GetTradingDay() string
- func (x *MarketData) GetTs() int64
- func (x *MarketData) GetTurnover() float64
- func (x *MarketData) GetUpperLimitPrice() float64
- func (x *MarketData) GetVolume() int64
- func (*MarketData) ProtoMessage()
- func (x *MarketData) ProtoReflect() protoreflect.Message
- func (x *MarketData) Reset()
- func (x *MarketData) String() string
- type MarketDatas
- type RangeReq
- func (*RangeReq) Descriptor() ([]byte, []int)deprecated
- func (x *RangeReq) GetEnd() int64
- func (x *RangeReq) GetStart() int64
- func (x *RangeReq) GetSymbol() string
- func (*RangeReq) ProtoMessage()
- func (x *RangeReq) ProtoReflect() protoreflect.Message
- func (x *RangeReq) Reset()
- func (x *RangeReq) String() string
- type UnimplementedCtpServer
- type UnsafeCtpServer
Constants ¶
const OperationCtpGetKline = "/ctpmonitor.pb.Ctp/GetKline"
const OperationCtpGetTick = "/ctpmonitor.pb.Ctp/GetTick"
Variables ¶
var Ctp_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ctpmonitor.pb.Ctp", HandlerType: (*CtpServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetKline", Handler: _Ctp_GetKline_Handler, }, { MethodName: "GetTick", Handler: _Ctp_GetTick_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ctp.proto", }
Ctp_ServiceDesc is the grpc.ServiceDesc for Ctp service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_ctp_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCtpHTTPServer ¶
func RegisterCtpHTTPServer(s *http.Server, srv CtpHTTPServer)
func RegisterCtpServer ¶
func RegisterCtpServer(s grpc.ServiceRegistrar, srv CtpServer)
Types ¶
type CtpClient ¶
type CtpClient interface { GetKline(ctx context.Context, in *KlineReq, opts ...grpc.CallOption) (*KlineResp, error) GetTick(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*MarketDatas, error) }
CtpClient is the client API for Ctp 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 NewCtpClient ¶
func NewCtpClient(cc grpc.ClientConnInterface) CtpClient
type CtpHTTPClient ¶
type CtpHTTPClient interface { GetKline(ctx context.Context, req *KlineReq, opts ...http.CallOption) (rsp *KlineResp, err error) GetTick(ctx context.Context, req *RangeReq, opts ...http.CallOption) (rsp *MarketDatas, err error) }
func NewCtpHTTPClient ¶
func NewCtpHTTPClient(client *http.Client) CtpHTTPClient
type CtpHTTPClientImpl ¶
type CtpHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*CtpHTTPClientImpl) GetKline ¶
func (c *CtpHTTPClientImpl) GetKline(ctx context.Context, in *KlineReq, opts ...http.CallOption) (*KlineResp, error)
func (*CtpHTTPClientImpl) GetTick ¶
func (c *CtpHTTPClientImpl) GetTick(ctx context.Context, in *RangeReq, opts ...http.CallOption) (*MarketDatas, error)
type CtpHTTPServer ¶
type CtpServer ¶
type CtpServer interface { GetKline(context.Context, *KlineReq) (*KlineResp, error) GetTick(context.Context, *RangeReq) (*MarketDatas, error) // contains filtered or unexported methods }
CtpServer is the server API for Ctp service. All implementations must embed UnimplementedCtpServer for forward compatibility
type KlineData ¶
type KlineData struct { Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` Open float64 `protobuf:"fixed64,2,opt,name=open,proto3" json:"open,omitempty"` High float64 `protobuf:"fixed64,3,opt,name=high,proto3" json:"high,omitempty"` Close float64 `protobuf:"fixed64,4,opt,name=close,proto3" json:"close,omitempty"` Low float64 `protobuf:"fixed64,5,opt,name=low,proto3" json:"low,omitempty"` Volume uint64 `protobuf:"varint,6,opt,name=volume,proto3" json:"volume,omitempty"` Turnover float64 `protobuf:"fixed64,7,opt,name=turnover,proto3" json:"turnover,omitempty"` // contains filtered or unexported fields }
func (*KlineData) Descriptor
deprecated
func (*KlineData) GetTurnover ¶
func (*KlineData) ProtoMessage ¶
func (*KlineData) ProtoMessage()
func (*KlineData) ProtoReflect ¶
func (x *KlineData) ProtoReflect() protoreflect.Message
type KlineReq ¶
type KlineReq struct { Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` Bin string `protobuf:"bytes,4,opt,name=bin,proto3" json:"bin,omitempty"` // contains filtered or unexported fields }
func (*KlineReq) Descriptor
deprecated
func (*KlineReq) ProtoMessage ¶
func (*KlineReq) ProtoMessage()
func (*KlineReq) ProtoReflect ¶
func (x *KlineReq) ProtoReflect() protoreflect.Message
type KlineResp ¶
type KlineResp struct { Data []*KlineData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*KlineResp) Descriptor
deprecated
func (*KlineResp) ProtoMessage ¶
func (*KlineResp) ProtoMessage()
func (*KlineResp) ProtoReflect ¶
func (x *KlineResp) ProtoReflect() protoreflect.Message
type MarketData ¶
type MarketData struct { Ts int64 `protobuf:"varint,1,opt,name=Ts,proto3" json:"Ts,omitempty"` TradingDay string `protobuf:"bytes,2,opt,name=TradingDay,proto3" json:"TradingDay,omitempty"` InstrumentID string `protobuf:"bytes,3,opt,name=InstrumentID,proto3" json:"InstrumentID,omitempty"` ExchangeID string `protobuf:"bytes,4,opt,name=ExchangeID,proto3" json:"ExchangeID,omitempty"` ExchangeInstID string `protobuf:"bytes,5,opt,name=ExchangeInstID,proto3" json:"ExchangeInstID,omitempty"` ActionDay string `protobuf:"bytes,6,opt,name=ActionDay,proto3" json:"ActionDay,omitempty"` LastPrice float64 `protobuf:"fixed64,7,opt,name=LastPrice,proto3" json:"LastPrice,omitempty"` PreSettlementPrice float64 `protobuf:"fixed64,8,opt,name=PreSettlementPrice,proto3" json:"PreSettlementPrice,omitempty"` PreClosePrice float64 `protobuf:"fixed64,9,opt,name=PreClosePrice,proto3" json:"PreClosePrice,omitempty"` PreOpenInterest float64 `protobuf:"fixed64,10,opt,name=PreOpenInterest,proto3" json:"PreOpenInterest,omitempty"` OpenPrice float64 `protobuf:"fixed64,11,opt,name=OpenPrice,proto3" json:"OpenPrice,omitempty"` HighestPrice float64 `protobuf:"fixed64,12,opt,name=HighestPrice,proto3" json:"HighestPrice,omitempty"` LowestPrice float64 `protobuf:"fixed64,13,opt,name=LowestPrice,proto3" json:"LowestPrice,omitempty"` Volume int64 `protobuf:"varint,14,opt,name=Volume,proto3" json:"Volume,omitempty"` Turnover float64 `protobuf:"fixed64,15,opt,name=Turnover,proto3" json:"Turnover,omitempty"` OpenInterest float64 `protobuf:"fixed64,16,opt,name=OpenInterest,proto3" json:"OpenInterest,omitempty"` ClosePrice float64 `protobuf:"fixed64,17,opt,name=ClosePrice,proto3" json:"ClosePrice,omitempty"` SettlementPrice float64 `protobuf:"fixed64,18,opt,name=SettlementPrice,proto3" json:"SettlementPrice,omitempty"` UpperLimitPrice float64 `protobuf:"fixed64,19,opt,name=UpperLimitPrice,proto3" json:"UpperLimitPrice,omitempty"` LowerLimitPrice float64 `protobuf:"fixed64,20,opt,name=LowerLimitPrice,proto3" json:"LowerLimitPrice,omitempty"` PreDelta float64 `protobuf:"fixed64,21,opt,name=PreDelta,proto3" json:"PreDelta,omitempty"` CurrDelta float64 `protobuf:"fixed64,22,opt,name=CurrDelta,proto3" json:"CurrDelta,omitempty"` BidPrice1 float64 `protobuf:"fixed64,23,opt,name=BidPrice1,proto3" json:"BidPrice1,omitempty"` BidVolume1 int64 `protobuf:"varint,24,opt,name=BidVolume1,proto3" json:"BidVolume1,omitempty"` AskPrice1 float64 `protobuf:"fixed64,25,opt,name=AskPrice1,proto3" json:"AskPrice1,omitempty"` AskVolume1 int64 `protobuf:"varint,26,opt,name=AskVolume1,proto3" json:"AskVolume1,omitempty"` BidPrice2 float64 `protobuf:"fixed64,27,opt,name=BidPrice2,proto3" json:"BidPrice2,omitempty"` BidVolume2 int64 `protobuf:"varint,28,opt,name=BidVolume2,proto3" json:"BidVolume2,omitempty"` AskPrice2 float64 `protobuf:"fixed64,29,opt,name=AskPrice2,proto3" json:"AskPrice2,omitempty"` AskVolume2 int64 `protobuf:"varint,30,opt,name=AskVolume2,proto3" json:"AskVolume2,omitempty"` BidPrice3 float64 `protobuf:"fixed64,31,opt,name=BidPrice3,proto3" json:"BidPrice3,omitempty"` BidVolume3 int64 `protobuf:"varint,32,opt,name=BidVolume3,proto3" json:"BidVolume3,omitempty"` AskPrice3 float64 `protobuf:"fixed64,33,opt,name=AskPrice3,proto3" json:"AskPrice3,omitempty"` AskVolume3 int64 `protobuf:"varint,34,opt,name=AskVolume3,proto3" json:"AskVolume3,omitempty"` BidPrice4 float64 `protobuf:"fixed64,35,opt,name=BidPrice4,proto3" json:"BidPrice4,omitempty"` BidVolume4 int64 `protobuf:"varint,36,opt,name=BidVolume4,proto3" json:"BidVolume4,omitempty"` AskPrice4 float64 `protobuf:"fixed64,37,opt,name=AskPrice4,proto3" json:"AskPrice4,omitempty"` AskVolume4 int64 `protobuf:"varint,38,opt,name=AskVolume4,proto3" json:"AskVolume4,omitempty"` BidPrice5 float64 `protobuf:"fixed64,39,opt,name=BidPrice5,proto3" json:"BidPrice5,omitempty"` BidVolume5 int64 `protobuf:"varint,40,opt,name=BidVolume5,proto3" json:"BidVolume5,omitempty"` AskPrice5 float64 `protobuf:"fixed64,41,opt,name=AskPrice5,proto3" json:"AskPrice5,omitempty"` AskVolume5 int64 `protobuf:"varint,42,opt,name=AskVolume5,proto3" json:"AskVolume5,omitempty"` AveragePrice float64 `protobuf:"fixed64,43,opt,name=AveragePrice,proto3" json:"AveragePrice,omitempty"` // contains filtered or unexported fields }
func (*MarketData) Descriptor
deprecated
func (*MarketData) Descriptor() ([]byte, []int)
Deprecated: Use MarketData.ProtoReflect.Descriptor instead.
func (*MarketData) GetActionDay ¶
func (x *MarketData) GetActionDay() string
func (*MarketData) GetAskPrice1 ¶
func (x *MarketData) GetAskPrice1() float64
func (*MarketData) GetAskPrice2 ¶
func (x *MarketData) GetAskPrice2() float64
func (*MarketData) GetAskPrice3 ¶
func (x *MarketData) GetAskPrice3() float64
func (*MarketData) GetAskPrice4 ¶
func (x *MarketData) GetAskPrice4() float64
func (*MarketData) GetAskPrice5 ¶
func (x *MarketData) GetAskPrice5() float64
func (*MarketData) GetAskVolume1 ¶
func (x *MarketData) GetAskVolume1() int64
func (*MarketData) GetAskVolume2 ¶
func (x *MarketData) GetAskVolume2() int64
func (*MarketData) GetAskVolume3 ¶
func (x *MarketData) GetAskVolume3() int64
func (*MarketData) GetAskVolume4 ¶
func (x *MarketData) GetAskVolume4() int64
func (*MarketData) GetAskVolume5 ¶
func (x *MarketData) GetAskVolume5() int64
func (*MarketData) GetAveragePrice ¶
func (x *MarketData) GetAveragePrice() float64
func (*MarketData) GetBidPrice1 ¶
func (x *MarketData) GetBidPrice1() float64
func (*MarketData) GetBidPrice2 ¶
func (x *MarketData) GetBidPrice2() float64
func (*MarketData) GetBidPrice3 ¶
func (x *MarketData) GetBidPrice3() float64
func (*MarketData) GetBidPrice4 ¶
func (x *MarketData) GetBidPrice4() float64
func (*MarketData) GetBidPrice5 ¶
func (x *MarketData) GetBidPrice5() float64
func (*MarketData) GetBidVolume1 ¶
func (x *MarketData) GetBidVolume1() int64
func (*MarketData) GetBidVolume2 ¶
func (x *MarketData) GetBidVolume2() int64
func (*MarketData) GetBidVolume3 ¶
func (x *MarketData) GetBidVolume3() int64
func (*MarketData) GetBidVolume4 ¶
func (x *MarketData) GetBidVolume4() int64
func (*MarketData) GetBidVolume5 ¶
func (x *MarketData) GetBidVolume5() int64
func (*MarketData) GetClosePrice ¶
func (x *MarketData) GetClosePrice() float64
func (*MarketData) GetCurrDelta ¶
func (x *MarketData) GetCurrDelta() float64
func (*MarketData) GetExchangeID ¶
func (x *MarketData) GetExchangeID() string
func (*MarketData) GetExchangeInstID ¶
func (x *MarketData) GetExchangeInstID() string
func (*MarketData) GetHighestPrice ¶
func (x *MarketData) GetHighestPrice() float64
func (*MarketData) GetInstrumentID ¶
func (x *MarketData) GetInstrumentID() string
func (*MarketData) GetLastPrice ¶
func (x *MarketData) GetLastPrice() float64
func (*MarketData) GetLowerLimitPrice ¶
func (x *MarketData) GetLowerLimitPrice() float64
func (*MarketData) GetLowestPrice ¶
func (x *MarketData) GetLowestPrice() float64
func (*MarketData) GetOpenInterest ¶
func (x *MarketData) GetOpenInterest() float64
func (*MarketData) GetOpenPrice ¶
func (x *MarketData) GetOpenPrice() float64
func (*MarketData) GetPreClosePrice ¶
func (x *MarketData) GetPreClosePrice() float64
func (*MarketData) GetPreDelta ¶
func (x *MarketData) GetPreDelta() float64
func (*MarketData) GetPreOpenInterest ¶
func (x *MarketData) GetPreOpenInterest() float64
func (*MarketData) GetPreSettlementPrice ¶
func (x *MarketData) GetPreSettlementPrice() float64
func (*MarketData) GetSettlementPrice ¶
func (x *MarketData) GetSettlementPrice() float64
func (*MarketData) GetTradingDay ¶
func (x *MarketData) GetTradingDay() string
func (*MarketData) GetTs ¶
func (x *MarketData) GetTs() int64
func (*MarketData) GetTurnover ¶
func (x *MarketData) GetTurnover() float64
func (*MarketData) GetUpperLimitPrice ¶
func (x *MarketData) GetUpperLimitPrice() float64
func (*MarketData) GetVolume ¶
func (x *MarketData) GetVolume() int64
func (*MarketData) ProtoMessage ¶
func (*MarketData) ProtoMessage()
func (*MarketData) ProtoReflect ¶
func (x *MarketData) ProtoReflect() protoreflect.Message
func (*MarketData) Reset ¶
func (x *MarketData) Reset()
func (*MarketData) String ¶
func (x *MarketData) String() string
type MarketDatas ¶
type MarketDatas struct { Data []*MarketData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*MarketDatas) Descriptor
deprecated
func (*MarketDatas) Descriptor() ([]byte, []int)
Deprecated: Use MarketDatas.ProtoReflect.Descriptor instead.
func (*MarketDatas) GetData ¶
func (x *MarketDatas) GetData() []*MarketData
func (*MarketDatas) ProtoMessage ¶
func (*MarketDatas) ProtoMessage()
func (*MarketDatas) ProtoReflect ¶
func (x *MarketDatas) ProtoReflect() protoreflect.Message
func (*MarketDatas) Reset ¶
func (x *MarketDatas) Reset()
func (*MarketDatas) String ¶
func (x *MarketDatas) String() string
type RangeReq ¶
type RangeReq struct { Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` // contains filtered or unexported fields }
func (*RangeReq) Descriptor
deprecated
func (*RangeReq) ProtoMessage ¶
func (*RangeReq) ProtoMessage()
func (*RangeReq) ProtoReflect ¶
func (x *RangeReq) ProtoReflect() protoreflect.Message
type UnimplementedCtpServer ¶
type UnimplementedCtpServer struct { }
UnimplementedCtpServer must be embedded to have forward compatible implementations.
func (UnimplementedCtpServer) GetTick ¶
func (UnimplementedCtpServer) GetTick(context.Context, *RangeReq) (*MarketDatas, error)
type UnsafeCtpServer ¶
type UnsafeCtpServer interface {
// contains filtered or unexported methods
}
UnsafeCtpServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CtpServer will result in compilation errors.