Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterStockServiceServer(s grpc.ServiceRegistrar, srv StockServiceServer)
- type Buy
- type BuySold
- type Sell
- func (*Sell) Descriptor() ([]byte, []int)deprecated
- func (x *Sell) GetBuysSold() []*BuySold
- func (x *Sell) GetCgtProfit() float64
- func (x *Sell) GetProfit() float64
- func (x *Sell) GetTaxMethod() TaxMethod
- func (x *Sell) GetTransaction() *Transaction
- func (*Sell) ProtoMessage()
- func (x *Sell) ProtoReflect() protoreflect.Message
- func (x *Sell) Reset()
- func (x *Sell) String() string
- type StockPosition
- func (*StockPosition) Descriptor() ([]byte, []int)deprecated
- func (x *StockPosition) GetBuys() []*Buy
- func (x *StockPosition) GetCgtProfit() float64
- func (x *StockPosition) GetNetSpend() float64
- func (x *StockPosition) GetQuantity() float64
- func (x *StockPosition) GetSells() []*Sell
- func (x *StockPosition) GetSoldProfit() float64
- func (x *StockPosition) GetTicker() string
- func (*StockPosition) ProtoMessage()
- func (x *StockPosition) ProtoReflect() protoreflect.Message
- func (x *StockPosition) Reset()
- func (x *StockPosition) String() string
- type StockPositions
- type StockRequest
- type StockServiceClient
- type StockServiceServer
- type StockTax
- func (*StockTax) Descriptor() ([]byte, []int)deprecated
- func (x *StockTax) GetEvents() []*TaxEvent
- func (x *StockTax) GetFinancialYear() string
- func (x *StockTax) GetGains() float64
- func (x *StockTax) GetGainsCgt() float64
- func (x *StockTax) GetGainsCgtAud() float64
- func (x *StockTax) GetLosses() float64
- func (x *StockTax) GetNetProfit() float64
- func (x *StockTax) GetNetProfitAud() float64
- func (x *StockTax) GetNetProfitCgt() float64
- func (x *StockTax) GetNetProfitCgtAud() float64
- func (*StockTax) ProtoMessage()
- func (x *StockTax) ProtoReflect() protoreflect.Message
- func (x *StockTax) Reset()
- func (x *StockTax) String() string
- type TaxEvent
- func (*TaxEvent) Descriptor() ([]byte, []int)deprecated
- func (x *TaxEvent) GetCgtProfit() float64
- func (x *TaxEvent) GetCgtProfitAud() float64
- func (x *TaxEvent) GetDate() *timestamppb.Timestamp
- func (x *TaxEvent) GetProfit() float64
- func (x *TaxEvent) GetProfitAud() float64
- func (x *TaxEvent) GetTicker() string
- func (*TaxEvent) ProtoMessage()
- func (x *TaxEvent) ProtoReflect() protoreflect.Message
- func (x *TaxEvent) Reset()
- func (x *TaxEvent) String() string
- type TaxMethod
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetBasis() float64
- func (x *Transaction) GetBrokerProfit() float64
- func (x *Transaction) GetBrokerageFee() float64
- func (x *Transaction) GetCurrency() string
- func (x *Transaction) GetDate() *timestamppb.Timestamp
- func (x *Transaction) GetId() string
- func (x *Transaction) GetProceeds() float64
- func (x *Transaction) GetQuantity() float64
- func (x *Transaction) GetRealPrice() float64
- func (x *Transaction) GetSplitFactor() float64
- func (x *Transaction) GetTicker() string
- func (x *Transaction) GetTradePrice() float64
- func (x *Transaction) GetType() TransactionType
- func (x *Transaction) GetUsdAud() float64
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type TransactionType
- func (TransactionType) Descriptor() protoreflect.EnumDescriptor
- func (x TransactionType) Enum() *TransactionType
- func (TransactionType) EnumDescriptor() ([]byte, []int)deprecated
- func (x TransactionType) Number() protoreflect.EnumNumber
- func (x TransactionType) String() string
- func (TransactionType) Type() protoreflect.EnumType
- type UnimplementedStockServiceServer
- type UnsafeStockServiceServer
Constants ¶
const (
StockService_GetStockPositions_FullMethodName = "/stock.StockService/GetStockPositions"
)
Variables ¶
var ( TaxMethod_name = map[int32]string{ 0: "FIFO", 1: "LIFO", 2: "MAX_LOSS", 3: "MIN_GAIN", 4: "MIN_CGT", } TaxMethod_value = map[string]int32{ "FIFO": 0, "LIFO": 1, "MAX_LOSS": 2, "MIN_GAIN": 3, "MIN_CGT": 4, } )
Enum value maps for TaxMethod.
var ( TransactionType_name = map[int32]string{ 0: "BUY", 1: "SELL", } TransactionType_value = map[string]int32{ "BUY": 0, "SELL": 1, } )
Enum value maps for TransactionType.
var File_stock_api_proto protoreflect.FileDescriptor
var File_stock_types_proto protoreflect.FileDescriptor
var StockService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "stock.StockService", HandlerType: (*StockServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStockPositions", Handler: _StockService_GetStockPositions_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "stock_api.proto", }
StockService_ServiceDesc is the grpc.ServiceDesc for StockService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStockServiceServer ¶
func RegisterStockServiceServer(s grpc.ServiceRegistrar, srv StockServiceServer)
Types ¶
type Buy ¶
type Buy struct { Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` QuantityLeft float64 `protobuf:"fixed64,2,opt,name=quantity_left,json=quantityLeft,proto3" json:"quantity_left,omitempty"` // contains filtered or unexported fields }
func (*Buy) Descriptor
deprecated
func (*Buy) GetQuantityLeft ¶
func (*Buy) GetTransaction ¶
func (x *Buy) GetTransaction() *Transaction
func (*Buy) ProtoMessage ¶
func (*Buy) ProtoMessage()
func (*Buy) ProtoReflect ¶
func (x *Buy) ProtoReflect() protoreflect.Message
type BuySold ¶
type BuySold struct { BuyId string `protobuf:"bytes,1,opt,name=Buy_id,json=BuyId,proto3" json:"Buy_id,omitempty"` Quantity float64 `protobuf:"fixed64,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*BuySold) Descriptor
deprecated
func (*BuySold) GetQuantity ¶
func (*BuySold) ProtoMessage ¶
func (*BuySold) ProtoMessage()
func (*BuySold) ProtoReflect ¶
func (x *BuySold) ProtoReflect() protoreflect.Message
type Sell ¶
type Sell struct { Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` TaxMethod TaxMethod `protobuf:"varint,2,opt,name=tax_method,json=taxMethod,proto3,enum=stock.TaxMethod" json:"tax_method,omitempty"` Profit float64 `protobuf:"fixed64,3,opt,name=profit,proto3" json:"profit,omitempty"` CgtProfit float64 `protobuf:"fixed64,4,opt,name=cgt_profit,json=cgtProfit,proto3" json:"cgt_profit,omitempty"` BuysSold []*BuySold `protobuf:"bytes,5,rep,name=buys_sold,json=buysSold,proto3" json:"buys_sold,omitempty"` // contains filtered or unexported fields }
func (*Sell) Descriptor
deprecated
func (*Sell) GetBuysSold ¶
func (*Sell) GetCgtProfit ¶
func (*Sell) GetTaxMethod ¶
func (*Sell) GetTransaction ¶
func (x *Sell) GetTransaction() *Transaction
func (*Sell) ProtoMessage ¶
func (*Sell) ProtoMessage()
func (*Sell) ProtoReflect ¶
func (x *Sell) ProtoReflect() protoreflect.Message
type StockPosition ¶
type StockPosition struct { Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` Quantity float64 `protobuf:"fixed64,2,opt,name=quantity,proto3" json:"quantity,omitempty"` NetSpend float64 `protobuf:"fixed64,3,opt,name=net_spend,json=netSpend,proto3" json:"net_spend,omitempty"` SoldProfit float64 `protobuf:"fixed64,4,opt,name=sold_profit,json=soldProfit,proto3" json:"sold_profit,omitempty"` CgtProfit float64 `protobuf:"fixed64,5,opt,name=cgt_profit,json=cgtProfit,proto3" json:"cgt_profit,omitempty"` Buys []*Buy `protobuf:"bytes,6,rep,name=buys,proto3" json:"buys,omitempty"` Sells []*Sell `protobuf:"bytes,7,rep,name=sells,proto3" json:"sells,omitempty"` // contains filtered or unexported fields }
func (*StockPosition) Descriptor
deprecated
func (*StockPosition) Descriptor() ([]byte, []int)
Deprecated: Use StockPosition.ProtoReflect.Descriptor instead.
func (*StockPosition) GetBuys ¶
func (x *StockPosition) GetBuys() []*Buy
func (*StockPosition) GetCgtProfit ¶
func (x *StockPosition) GetCgtProfit() float64
func (*StockPosition) GetNetSpend ¶
func (x *StockPosition) GetNetSpend() float64
func (*StockPosition) GetQuantity ¶
func (x *StockPosition) GetQuantity() float64
func (*StockPosition) GetSells ¶
func (x *StockPosition) GetSells() []*Sell
func (*StockPosition) GetSoldProfit ¶
func (x *StockPosition) GetSoldProfit() float64
func (*StockPosition) GetTicker ¶
func (x *StockPosition) GetTicker() string
func (*StockPosition) ProtoMessage ¶
func (*StockPosition) ProtoMessage()
func (*StockPosition) ProtoReflect ¶
func (x *StockPosition) ProtoReflect() protoreflect.Message
func (*StockPosition) Reset ¶
func (x *StockPosition) Reset()
func (*StockPosition) String ¶
func (x *StockPosition) String() string
type StockPositions ¶
type StockPositions struct { Positions []*StockPosition `protobuf:"bytes,1,rep,name=positions,proto3" json:"positions,omitempty"` // contains filtered or unexported fields }
func (*StockPositions) Descriptor
deprecated
func (*StockPositions) Descriptor() ([]byte, []int)
Deprecated: Use StockPositions.ProtoReflect.Descriptor instead.
func (*StockPositions) GetPositions ¶
func (x *StockPositions) GetPositions() []*StockPosition
func (*StockPositions) ProtoMessage ¶
func (*StockPositions) ProtoMessage()
func (*StockPositions) ProtoReflect ¶
func (x *StockPositions) ProtoReflect() protoreflect.Message
func (*StockPositions) Reset ¶
func (x *StockPositions) Reset()
func (*StockPositions) String ¶
func (x *StockPositions) String() string
type StockRequest ¶
type StockRequest struct {
// contains filtered or unexported fields
}
func (*StockRequest) Descriptor
deprecated
func (*StockRequest) Descriptor() ([]byte, []int)
Deprecated: Use StockRequest.ProtoReflect.Descriptor instead.
func (*StockRequest) ProtoMessage ¶
func (*StockRequest) ProtoMessage()
func (*StockRequest) ProtoReflect ¶
func (x *StockRequest) ProtoReflect() protoreflect.Message
func (*StockRequest) Reset ¶
func (x *StockRequest) Reset()
func (*StockRequest) String ¶
func (x *StockRequest) String() string
type StockServiceClient ¶
type StockServiceClient interface {
GetStockPositions(ctx context.Context, in *StockRequest, opts ...grpc.CallOption) (*StockPositions, error)
}
StockServiceClient is the client API for StockService 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 NewStockServiceClient ¶
func NewStockServiceClient(cc grpc.ClientConnInterface) StockServiceClient
type StockServiceServer ¶
type StockServiceServer interface { GetStockPositions(context.Context, *StockRequest) (*StockPositions, error) // contains filtered or unexported methods }
StockServiceServer is the server API for StockService service. All implementations must embed UnimplementedStockServiceServer for forward compatibility
type StockTax ¶
type StockTax struct { FinancialYear string `protobuf:"bytes,1,opt,name=financial_year,json=financialYear,proto3" json:"financial_year,omitempty"` NetProfitCgt float64 `protobuf:"fixed64,2,opt,name=net_profit_cgt,json=netProfitCgt,proto3" json:"net_profit_cgt,omitempty"` NetProfitCgtAud float64 `protobuf:"fixed64,3,opt,name=net_profit_cgt_aud,json=netProfitCgtAud,proto3" json:"net_profit_cgt_aud,omitempty"` NetProfit float64 `protobuf:"fixed64,4,opt,name=net_profit,json=netProfit,proto3" json:"net_profit,omitempty"` NetProfitAud float64 `protobuf:"fixed64,5,opt,name=net_profit_aud,json=netProfitAud,proto3" json:"net_profit_aud,omitempty"` GainsCgt float64 `protobuf:"fixed64,6,opt,name=gains_cgt,json=gainsCgt,proto3" json:"gains_cgt,omitempty"` GainsCgtAud float64 `protobuf:"fixed64,7,opt,name=gains_cgt_aud,json=gainsCgtAud,proto3" json:"gains_cgt_aud,omitempty"` Gains float64 `protobuf:"fixed64,8,opt,name=gains,proto3" json:"gains,omitempty"` Losses float64 `protobuf:"fixed64,9,opt,name=losses,proto3" json:"losses,omitempty"` Events []*TaxEvent `protobuf:"bytes,10,rep,name=events,proto3" json:"events,omitempty"` // contains filtered or unexported fields }
func (*StockTax) Descriptor
deprecated
func (*StockTax) GetFinancialYear ¶
func (*StockTax) GetGainsCgt ¶
func (*StockTax) GetGainsCgtAud ¶
func (*StockTax) GetNetProfit ¶
func (*StockTax) GetNetProfitAud ¶
func (*StockTax) GetNetProfitCgt ¶
func (*StockTax) GetNetProfitCgtAud ¶
func (*StockTax) ProtoMessage ¶
func (*StockTax) ProtoMessage()
func (*StockTax) ProtoReflect ¶
func (x *StockTax) ProtoReflect() protoreflect.Message
type TaxEvent ¶
type TaxEvent struct { Date *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"` Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` Profit float64 `protobuf:"fixed64,3,opt,name=profit,proto3" json:"profit,omitempty"` ProfitAud float64 `protobuf:"fixed64,4,opt,name=profit_aud,json=profitAud,proto3" json:"profit_aud,omitempty"` CgtProfit float64 `protobuf:"fixed64,5,opt,name=cgt_profit,json=cgtProfit,proto3" json:"cgt_profit,omitempty"` CgtProfitAud float64 `protobuf:"fixed64,6,opt,name=cgt_profit_aud,json=cgtProfitAud,proto3" json:"cgt_profit_aud,omitempty"` // contains filtered or unexported fields }
func (*TaxEvent) Descriptor
deprecated
func (*TaxEvent) GetCgtProfit ¶
func (*TaxEvent) GetCgtProfitAud ¶
func (*TaxEvent) GetDate ¶
func (x *TaxEvent) GetDate() *timestamppb.Timestamp
func (*TaxEvent) GetProfitAud ¶
func (*TaxEvent) ProtoMessage ¶
func (*TaxEvent) ProtoMessage()
func (*TaxEvent) ProtoReflect ¶
func (x *TaxEvent) ProtoReflect() protoreflect.Message
type TaxMethod ¶
type TaxMethod int32
func (TaxMethod) Descriptor ¶
func (TaxMethod) Descriptor() protoreflect.EnumDescriptor
func (TaxMethod) EnumDescriptor
deprecated
func (TaxMethod) Number ¶
func (x TaxMethod) Number() protoreflect.EnumNumber
func (TaxMethod) Type ¶
func (TaxMethod) Type() protoreflect.EnumType
type Transaction ¶
type Transaction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` Currency string `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"` Date *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=date,proto3" json:"date,omitempty"` Type TransactionType `protobuf:"varint,5,opt,name=type,proto3,enum=stock.TransactionType" json:"type,omitempty"` Quantity float64 `protobuf:"fixed64,6,opt,name=quantity,proto3" json:"quantity,omitempty"` TradePrice float64 `protobuf:"fixed64,7,opt,name=trade_price,json=tradePrice,proto3" json:"trade_price,omitempty"` RealPrice float64 `protobuf:"fixed64,8,opt,name=real_price,json=realPrice,proto3" json:"real_price,omitempty"` Proceeds float64 `protobuf:"fixed64,9,opt,name=proceeds,proto3" json:"proceeds,omitempty"` BrokerageFee float64 `protobuf:"fixed64,10,opt,name=brokerage_fee,json=brokerageFee,proto3" json:"brokerage_fee,omitempty"` Basis float64 `protobuf:"fixed64,11,opt,name=basis,proto3" json:"basis,omitempty"` BrokerProfit float64 `protobuf:"fixed64,12,opt,name=broker_profit,json=brokerProfit,proto3" json:"broker_profit,omitempty"` UsdAud float64 `protobuf:"fixed64,13,opt,name=usd_aud,json=usdAud,proto3" json:"usd_aud,omitempty"` SplitFactor float64 `protobuf:"fixed64,14,opt,name=split_factor,json=splitFactor,proto3" json:"split_factor,omitempty"` // contains filtered or unexported fields }
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetBasis ¶
func (x *Transaction) GetBasis() float64
func (*Transaction) GetBrokerProfit ¶
func (x *Transaction) GetBrokerProfit() float64
func (*Transaction) GetBrokerageFee ¶
func (x *Transaction) GetBrokerageFee() float64
func (*Transaction) GetCurrency ¶
func (x *Transaction) GetCurrency() string
func (*Transaction) GetDate ¶
func (x *Transaction) GetDate() *timestamppb.Timestamp
func (*Transaction) GetId ¶
func (x *Transaction) GetId() string
func (*Transaction) GetProceeds ¶
func (x *Transaction) GetProceeds() float64
func (*Transaction) GetQuantity ¶
func (x *Transaction) GetQuantity() float64
func (*Transaction) GetRealPrice ¶
func (x *Transaction) GetRealPrice() float64
func (*Transaction) GetSplitFactor ¶
func (x *Transaction) GetSplitFactor() float64
func (*Transaction) GetTicker ¶
func (x *Transaction) GetTicker() string
func (*Transaction) GetTradePrice ¶
func (x *Transaction) GetTradePrice() float64
func (*Transaction) GetType ¶
func (x *Transaction) GetType() TransactionType
func (*Transaction) GetUsdAud ¶
func (x *Transaction) GetUsdAud() float64
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
type TransactionType ¶
type TransactionType int32
const ( TransactionType_BUY TransactionType = 0 TransactionType_SELL TransactionType = 1 )
func (TransactionType) Descriptor ¶
func (TransactionType) Descriptor() protoreflect.EnumDescriptor
func (TransactionType) Enum ¶
func (x TransactionType) Enum() *TransactionType
func (TransactionType) EnumDescriptor
deprecated
func (TransactionType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TransactionType.Descriptor instead.
func (TransactionType) Number ¶
func (x TransactionType) Number() protoreflect.EnumNumber
func (TransactionType) String ¶
func (x TransactionType) String() string
func (TransactionType) Type ¶
func (TransactionType) Type() protoreflect.EnumType
type UnimplementedStockServiceServer ¶
type UnimplementedStockServiceServer struct { }
UnimplementedStockServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedStockServiceServer) GetStockPositions ¶
func (UnimplementedStockServiceServer) GetStockPositions(context.Context, *StockRequest) (*StockPositions, error)
type UnsafeStockServiceServer ¶
type UnsafeStockServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStockServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StockServiceServer will result in compilation errors.