portfolio

package
v0.0.0-...-c2ac3d6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ENUMS = 7

Ensure that ENUMS is equal to the amount of Sector Enums

Variables

This section is empty.

Functions

func GetMarketPrice

func GetMarketPrice(stonk string) float32

GetMarketPrice() -> Get's current price of stocks

Types

type Portfolio

type Portfolio []Tranche

type Sector

type Sector int8
const (
	Domesitc Sector = iota
	Emerging
	Developed
	Government
	TIPS
	REITS
	Individual
)

Enums for all the Sectors

func GetSector

func GetSector(stonk string) Sector

GetSector() -> gets the sector from the

func (Sector) String

func (s Sector) String() string

String() -> Enum to String

type SectorBase

type SectorBase map[Sector][]Stonk

type SectorFunc

type SectorFunc interface {
	// Ensure that all the functions are of equal length to (iota) Enums
	String() string
}

type Stonk

type Stonk struct {
	Name   string
	Price  float32
	Sector Sector
}

Stonk:

func GenerateStonk

func GenerateStonk(name string) (Stonk, error)

GenerateStonk() -> Generate a Stonk from name

func (*Stonk) Reblance

func (s *Stonk) Reblance()

type Tranche

type Tranche struct {
	SectorBase
	Percentage float32
}

Jump to

Keyboard shortcuts

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