From 6e504199ccd7000dfbb27fae4044175ada4c077c Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 8 Nov 2019 22:26:17 -0500 Subject: [PATCH] Adding types to the project --- Gopkg.lock | 9 +++++++++ Gopkg.toml | 30 ++++++++++++++++++++++++++++++ main.go | 1 + types.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml create mode 100644 types.go diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..10ef811 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,9 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..d7072c2 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,30 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[prune] + go-tests = true + unused-packages = true diff --git a/main.go b/main.go index a90e744..2ccadf3 100644 --- a/main.go +++ b/main.go @@ -47,5 +47,6 @@ func main() { defer resp.Body.Close() b, _ := ioutil.ReadAll(resp.Body) + fmt.Printf("Got %s from Ally\n", b) } diff --git a/types.go b/types.go new file mode 100644 index 0000000..6c559e1 --- /dev/null +++ b/types.go @@ -0,0 +1,50 @@ +type AllyResponse struct { +} + +type AllyAccounts struct { + Accounts []AllyAccount +} + +type AllyAccount struct { + Summary AccountSummary `xml:"accountsummary"` +} + +type AccountSummary struct { + Account int `xml:"accountsummary>account"` + AccountName string `xml:"accountsummary>accountname"` + Balance AccountBalance + Holdings AccountHoldings +} + +type AccountBalance struct { + Account int + AccountValue float64 + BuyingPower BuyingPower + FedCall int + HouseCall int + Money Money + Securities Securities +} + +type BuyingPower struct { + CashAvailableForWithdrawal float64 + DayTrading int + EquityPercentage int + Options int + SodDayTrading int + SodOptions int + SodStock int + Stock int +} + +type Money struct { + AccruedInterest float64 + Cash float64 + CashAvailable float64 + MarginBalance int + Mmf int + Total int + UnclearedDeposits float64 + UnsettledFunds float64 + Yield float64 +} \ No newline at end of file