stockpb

package
v0.0.0-...-92102cf Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StockService_GetStockPositions_FullMethodName = "/stock.StockService/GetStockPositions"
)

Variables

View Source
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.

View Source
var (
	TransactionType_name = map[int32]string{
		0: "BUY",
		1: "SELL",
	}
	TransactionType_value = map[string]int32{
		"BUY":  0,
		"SELL": 1,
	}
)

Enum value maps for TransactionType.

View Source
var File_stock_api_proto protoreflect.FileDescriptor
View Source
var File_stock_types_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Buy.ProtoReflect.Descriptor instead.

func (*Buy) GetQuantityLeft

func (x *Buy) GetQuantityLeft() float64

func (*Buy) GetTransaction

func (x *Buy) GetTransaction() *Transaction

func (*Buy) ProtoMessage

func (*Buy) ProtoMessage()

func (*Buy) ProtoReflect

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

func (*Buy) Reset

func (x *Buy) Reset()

func (*Buy) String

func (x *Buy) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use BuySold.ProtoReflect.Descriptor instead.

func (*BuySold) GetBuyId

func (x *BuySold) GetBuyId() string

func (*BuySold) GetQuantity

func (x *BuySold) GetQuantity() float64

func (*BuySold) ProtoMessage

func (*BuySold) ProtoMessage()

func (*BuySold) ProtoReflect

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

func (*BuySold) Reset

func (x *BuySold) Reset()

func (*BuySold) String

func (x *BuySold) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Sell.ProtoReflect.Descriptor instead.

func (*Sell) GetBuysSold

func (x *Sell) GetBuysSold() []*BuySold

func (*Sell) GetCgtProfit

func (x *Sell) GetCgtProfit() float64

func (*Sell) GetProfit

func (x *Sell) GetProfit() float64

func (*Sell) GetTaxMethod

func (x *Sell) GetTaxMethod() TaxMethod

func (*Sell) GetTransaction

func (x *Sell) GetTransaction() *Transaction

func (*Sell) ProtoMessage

func (*Sell) ProtoMessage()

func (*Sell) ProtoReflect

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

func (*Sell) Reset

func (x *Sell) Reset()

func (*Sell) String

func (x *Sell) String() string

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use StockTax.ProtoReflect.Descriptor instead.

func (*StockTax) GetEvents

func (x *StockTax) GetEvents() []*TaxEvent

func (*StockTax) GetFinancialYear

func (x *StockTax) GetFinancialYear() string

func (*StockTax) GetGains

func (x *StockTax) GetGains() float64

func (*StockTax) GetGainsCgt

func (x *StockTax) GetGainsCgt() float64

func (*StockTax) GetGainsCgtAud

func (x *StockTax) GetGainsCgtAud() float64

func (*StockTax) GetLosses

func (x *StockTax) GetLosses() float64

func (*StockTax) GetNetProfit

func (x *StockTax) GetNetProfit() float64

func (*StockTax) GetNetProfitAud

func (x *StockTax) GetNetProfitAud() float64

func (*StockTax) GetNetProfitCgt

func (x *StockTax) GetNetProfitCgt() float64

func (*StockTax) GetNetProfitCgtAud

func (x *StockTax) GetNetProfitCgtAud() float64

func (*StockTax) ProtoMessage

func (*StockTax) ProtoMessage()

func (*StockTax) ProtoReflect

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

func (*StockTax) Reset

func (x *StockTax) Reset()

func (*StockTax) String

func (x *StockTax) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use TaxEvent.ProtoReflect.Descriptor instead.

func (*TaxEvent) GetCgtProfit

func (x *TaxEvent) GetCgtProfit() float64

func (*TaxEvent) GetCgtProfitAud

func (x *TaxEvent) GetCgtProfitAud() float64

func (*TaxEvent) GetDate

func (x *TaxEvent) GetDate() *timestamppb.Timestamp

func (*TaxEvent) GetProfit

func (x *TaxEvent) GetProfit() float64

func (*TaxEvent) GetProfitAud

func (x *TaxEvent) GetProfitAud() float64

func (*TaxEvent) GetTicker

func (x *TaxEvent) GetTicker() string

func (*TaxEvent) ProtoMessage

func (*TaxEvent) ProtoMessage()

func (*TaxEvent) ProtoReflect

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

func (*TaxEvent) Reset

func (x *TaxEvent) Reset()

func (*TaxEvent) String

func (x *TaxEvent) String() string

type TaxMethod

type TaxMethod int32
const (
	TaxMethod_FIFO     TaxMethod = 0
	TaxMethod_LIFO     TaxMethod = 1
	TaxMethod_MAX_LOSS TaxMethod = 2
	TaxMethod_MIN_GAIN TaxMethod = 3
	TaxMethod_MIN_CGT  TaxMethod = 4
)

func (TaxMethod) Descriptor

func (TaxMethod) Descriptor() protoreflect.EnumDescriptor

func (TaxMethod) Enum

func (x TaxMethod) Enum() *TaxMethod

func (TaxMethod) EnumDescriptor deprecated

func (TaxMethod) EnumDescriptor() ([]byte, []int)

Deprecated: Use TaxMethod.Descriptor instead.

func (TaxMethod) Number

func (x TaxMethod) Number() protoreflect.EnumNumber

func (TaxMethod) String

func (x TaxMethod) String() string

func (TaxMethod) Type

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) Enum

func (x TransactionType) Enum() *TransactionType

func (TransactionType) EnumDescriptor deprecated

func (TransactionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use TransactionType.Descriptor instead.

func (TransactionType) Number

func (TransactionType) String

func (x TransactionType) String() string

func (TransactionType) Type

type UnimplementedStockServiceServer

type UnimplementedStockServiceServer struct {
}

UnimplementedStockServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedStockServiceServer) GetStockPositions

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.

Jump to

Keyboard shortcuts

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