models

package
v0.0.0-...-42acf81 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Investment

type Investment struct {
	ID       int
	UserID   string
	Ticker   string
	Quantity int
}

type Portfolio

type Portfolio struct {
	UserID      string
	Investments []Investment
	Turnips     int
}

Portfolio represents a user's portfolio complete with investments and turnips

type PortfolioValue

type PortfolioValue struct {
	UserID   string
	Username string
	Value    int
}

PortfolioValue holds user information for a whole portfolio's value

type SortedPortfolioValue

type SortedPortfolioValue []PortfolioValue

SortedPortfolioValue is the interface used to sort portfolio values

func (SortedPortfolioValue) Len

func (s SortedPortfolioValue) Len() int

Len returns the lenght of the SortedPortfolioValue

func (SortedPortfolioValue) Less

func (s SortedPortfolioValue) Less(i, j int) bool

Less returns true if SortedPortfolioValues at index i is less than index j

func (SortedPortfolioValue) Swap

func (s SortedPortfolioValue) Swap(i, j int)

Swap swaps positions of the SortedPortfolioValues

type Stock

type Stock struct {
	Name   string
	Price  int
	Change string
}

func CheckStock

func CheckStock(symbol string) *Stock

type User

type User struct {
	UserID   string
	Username string
	Turnips  int
}

User represents a user in the database

Jump to

Keyboard shortcuts

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