handler

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Benchmark

func Benchmark(c *fiber.Ctx) (resp error)

func CreatePortfolio

func CreatePortfolio(c *fiber.Ctx) error

func DeletePortfolio

func DeletePortfolio(c *fiber.Ctx) error

DeletePortfolio delete portfolio

func GetAPIKey

func GetAPIKey(c *fiber.Ctx) error

func GetActivity

func GetActivity(c *fiber.Ctx, sqlQuery string, args ...any) error

func GetAllActivity

func GetAllActivity(c *fiber.Ctx) error

func GetAnnouncements

func GetAnnouncements(c *fiber.Ctx) error

func GetPortfolio

func GetPortfolio(c *fiber.Ctx) error

GetPortfolio get a portfolio @Description Retrieve a portfolio saved on the server @Id GetPortfolio @Produce json @Param id path string true "id of porfolio to retrieve"

func GetPortfolioActivity

func GetPortfolioActivity(c *fiber.Ctx) error

func GetPortfolioHoldings

func GetPortfolioHoldings(c *fiber.Ctx) error

func GetPortfolioMeasurements

func GetPortfolioMeasurements(c *fiber.Ctx) error

func GetPortfolioPerformance

func GetPortfolioPerformance(c *fiber.Ctx) error

func GetPortfolioTransactions

func GetPortfolioTransactions(c *fiber.Ctx) error

func GetStrategy

func GetStrategy(c *fiber.Ctx) error

GetStrategy get configuration for a specific strategy

func ListPortfolios

func ListPortfolios(c *fiber.Ctx) error

ListPortfolios list all portfolios for logged in user

func ListStrategies

func ListStrategies(c *fiber.Ctx) error

ListStrategies get a list of all strategies

func LookupSecurity added in v0.5.0

func LookupSecurity(c *fiber.Ctx) error

func Ping

func Ping(c *fiber.Ctx) error

func RunStrategy

func RunStrategy(c *fiber.Ctx) (resp error)

RunStrategy executes the strategy

func UpdatePortfolio

func UpdatePortfolio(c *fiber.Ctx) error

UpdatePortfolio loads the portfolio from the database and updates it with the values passed via the PATCH command

Types

type APIKeyResponse

type APIKeyResponse struct {
	Token string `json:"token"`
}

ApiKey returns a hex-encoded JSON string containing the userID

type Activity

type Activity struct {
	ID          string   `json:"id"`
	PortfolioID string   `json:"portfolio_id"`
	Date        string   `json:"date"`
	Activity    string   `json:"message"`
	Tags        []string `json:"tags"`
}

type Announcement

type Announcement struct {
	ID      string   `json:"id"`
	Date    string   `json:"date"`
	Expires string   `json:"expires"`
	Message string   `json:"message"`
	Tags    []string `json:"tags"`
}

type PingResponse

type PingResponse struct {
	Status  string `json:"status" example:"success"`
	Message string `json:"message" example:"API is alive"`
	Time    string `json:"time" example:"2021-06-19T08:09:10.115924-05:00"`
}

type PortfolioResponse

type PortfolioResponse struct {
	ID                 uuid.UUID              `json:"id"`
	Name               string                 `json:"name"`
	AccountType        string                 `json:"accountType"`
	AccountNumber      string                 `json:"accountNumber"`
	Brokerage          string                 `json:"brokerage"`
	IsOpen             bool                   `json:"isOpen"`
	Strategy           string                 `json:"strategy"`
	Arguments          map[string]interface{} `json:"arguments"`
	StartDate          int64                  `json:"startDate"`
	TaxLotMethod       string                 `json:"taxLotMethod"`
	BenchmarkTicker    string                 `json:"benchmarkTicker"`
	Status             string                 `json:"status"`
	YTDReturn          pgtype.Float8          `json:"ytdReturn"`
	CAGRSinceInception pgtype.Float8          `json:"cagrSinceInception"`
	Notifications      int                    `json:"notifications"`
	Cagr3Year          pgtype.Float4          `json:"cagr3Year"`
	Cagr5Year          pgtype.Float4          `json:"cagr5Year"`
	Cagr10Year         pgtype.Float4          `json:"cagr10Year"`
	StdDev             pgtype.Float4          `json:"stdDev"`
	DownsideDeviation  pgtype.Float4          `json:"downsideDeviation"`
	MaxDrawDown        pgtype.Float4          `json:"maxDrawDown"`
	AvgDrawDown        pgtype.Float4          `json:"avgDrawDown"`
	SharpeRatio        pgtype.Float4          `json:"sharpeRatio"`
	SortinoRatio       pgtype.Float4          `json:"sortinoRatio"`
	UlcerIndex         pgtype.Float4          `json:"ulcerIndex"`
	NextTradeDate      pgtype.Int4            `json:"nextTradeDate"`
	LastViewed         int64                  `json:"lastViewed"`
	Created            int64                  `json:"created"`
	LastChanged        int64                  `json:"lastChanged"`
}

func NewPortfolioResponse

func NewPortfolioResponse() PortfolioResponse

func (*PortfolioResponse) Sanitize

func (pr *PortfolioResponse) Sanitize()

type SecurityDetail added in v0.5.0

type SecurityDetail struct {
	CompositeFigi string `json:"compositeFigi"`
	Cusip         string `json:"cusip"`
	Name          string `json:"name"`
	Ticker        string `json:"ticker"`
}

Jump to

Keyboard shortcuts

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