Documentation
¶
Index ¶
- Variables
- type Account
- type AccountHandler
- type AccountStore
- type AccountsGroupByCategory
- type AssetAllocation
- type AssetAllocationPct
- type AssetCategory
- type AuthHandler
- type Benchmark
- type BenchmarkHandler
- type BenchmarkStore
- type CreateAccountResponse
- type CreateBenchmarkResponse
- type CreateHoldingResponse
- type CreateSnapshotResponse
- type CreateSnapshotValueResponse
- type DeleteAccountResponse
- type DeleteBenchmarkResponse
- type DeleteHoldingResponse
- type DeleteSnapshotResponse
- type DeleteSnapshotValueResponse
- type DeleteUserResponse
- type GetAccountResponse
- type GetAccountsResponse
- type GetAccountsStoreOptions
- type GetBenchmarkResponse
- type GetBenchmarksResponse
- type GetBenchmarksStoreOptions
- type GetGroupByAccountStoreOptions
- type GetGroupByHoldingStoreOptions
- type GetGroupByMaturationDateStoreOptions
- type GetHoldingResponse
- type GetHoldingsResponse
- type GetHoldingsStoreOptions
- type GetMeResponse
- type GetSettingsResponse
- type GetSnapshotAccountsResponse
- type GetSnapshotHoldingsResponse
- type GetSnapshotLiquidityResponse
- type GetSnapshotMaturationDateResponse
- type GetSnapshotRebalanceResponse
- type GetSnapshotResponse
- type GetSnapshotTotalStoreOptions
- type GetSnapshotValueResponse
- type GetSnapshotValuesResponse
- type GetSnapshotsResponse
- type GetSnapshotsStoreOptions
- type GetUserByIdResponse
- type GetUsersStoreOptions
- type Holding
- type HoldingHandler
- type HoldingStore
- type HoldingsGroupByCategory
- type LiquidityResource
- type LoginResponse
- type MaturationDateResource
- type PaginationMetadata
- type PaginationQuery
- type RegisterResponse
- type ResourcesGrouped
- type Settings
- type Snapshot
- type SnapshotHandler
- type SnapshotStore
- type SnapshotValue
- type SnapshotValueHandler
- type SnapshotValueStore
- type TaxShelter
- type UpdateAccountResponse
- type UpdateBenchmarkResponse
- type UpdateHoldingResponse
- type UpdateSettingsResponse
- type UpdateSnapshotResponse
- type UpdateSnapshotValueResponse
- type User
- type UserHandler
- type UserRole
- type UserStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidAssetCategories = []interface{}{ CASH, BILLS, STB, ITB, LTB, COMMODITIES, GOLD, REITS, TSM, DLCB, DLCG, DLCV, DMCB, DMCG, DMCV, DSCG, DSCB, DSCV, ILCB, ILCG, ILCV, IMCB, IMCG, IMCV, ISCB, ISCG, ISCV, CRYPTO, OTHER, }
View Source
var ValidTaxShelters = []interface{}{ TAXABLE, TRADITIONAL, ROTH, HSA, FIVE_TWENTY_NINE, }
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Account_id int `json:"account_id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` Tax_shelter TaxShelter `json:"tax_shelter"` Institution string `json:"institution"` Is_deprecated bool `json:"is_deprecated"` User_id int `json:"user_id"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type AccountHandler ¶
type AccountStore ¶
type AccountStore interface { CreateAccount(context.Context, *Account) (Account, error) GetAccounts(ctx context.Context, userId int, options *GetAccountsStoreOptions) ([]Account, PaginationMetadata, error) GetAccountById(ctx context.Context, userId, accountId int) (Account, error) GetAccountByName(ctx context.Context, name string, userId int) (Account, error) UpdateAccount(context.Context, *Account) (Account, error) DeleteAccount(ctx context.Context, userId, accountId int) (Account, error) }
type AccountsGroupByCategory ¶
type AccountsGroupByCategory string
const ( BY_ACCOUNT_NAME AccountsGroupByCategory = "ACCOUNT_NAME" BY_ACCOUNT_INSTITUTION AccountsGroupByCategory = "ACCOUNT_INSTITUTION" BY_TAX_SHELTER AccountsGroupByCategory = "TAX_SHELTER" )
type AssetAllocation ¶
type AssetAllocationPct ¶
type AssetAllocationPct struct { Category AssetCategory `json:"category"` Percent int `json:"percent"` }
type AssetCategory ¶
type AssetCategory = string
const ( CASH AssetCategory = "CASH" BILLS AssetCategory = "BILLS" STB AssetCategory = "STB" ITB AssetCategory = "ITB" LTB AssetCategory = "LTB" COMMODITIES AssetCategory = "COMMODITIES" GOLD AssetCategory = "GOLD" REITS AssetCategory = "REITS" TSM AssetCategory = "TSM" DLCB AssetCategory = "DLCB" DLCG AssetCategory = "DLCG" DLCV AssetCategory = "DLCV" DMCB AssetCategory = "DMCB" DMCG AssetCategory = "DMCG" DMCV AssetCategory = "DMCV" DSCG AssetCategory = "DSCG" DSCB AssetCategory = "DSCB" DSCV AssetCategory = "DSCV" ILCB AssetCategory = "ILCB" ILCG AssetCategory = "ILCG" ILCV AssetCategory = "ILCV" IMCB AssetCategory = "IMCB" IMCG AssetCategory = "IMCG" IMCV AssetCategory = "IMCV" ISCB AssetCategory = "ISCB" ISCG AssetCategory = "ISCG" ISCV AssetCategory = "ISCV" CRYPTO AssetCategory = "CRYPTO" OTHER AssetCategory = "OTHER" )
type AuthHandler ¶
type Benchmark ¶
type Benchmark struct { Benchmark_id int `json:"benchmark_id"` Name string `json:"name"` Description string `json:"description"` Asset_allocation []AssetAllocationPct `json:"asset_allocation"` Std_dev_pct float32 `json:"std_dev_pct"` Real_return_pct float32 `json:"real_return_pct"` Drawdown_yrs int `json:"drawdown_yrs"` Is_deprecated bool `json:"is_deprecated"` User_id int `json:"user_id"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type BenchmarkHandler ¶
type BenchmarkStore ¶
type BenchmarkStore interface { CreateBenchmark(context.Context, *Benchmark) (Benchmark, error) GetBenchmarks(ctx context.Context, userId int, options *GetBenchmarksStoreOptions) ([]Benchmark, PaginationMetadata, error) GetBenchmarkById(ctx context.Context, userId, benchmarkId int) (Benchmark, error) GetBenchmarkByName(ctx context.Context, name string, userId int) (Benchmark, error) UpdateBenchmark(context.Context, *Benchmark) (Benchmark, error) DeleteBenchmark(ctx context.Context, userId, benchmarkId int) (Benchmark, error) }
type CreateAccountResponse ¶
type CreateBenchmarkResponse ¶
type CreateBenchmarkResponse struct { Data struct { Benchmark Benchmark `json:"benchmark"` } `json:"data"` Error string `json:"error"` }
---- Benchmark Response Types ----
type CreateHoldingResponse ¶
type CreateSnapshotResponse ¶
type CreateSnapshotResponse struct { Data struct { Snapshot Snapshot `json:"snapshot"` Snapshot_values []SnapshotValue `json:"snapshot_values"` } `json:"data"` Error string `json:"error"` }
---- Snapshot Response Types ----
type CreateSnapshotValueResponse ¶
type CreateSnapshotValueResponse struct { Data struct { Snapshot_value SnapshotValue `json:"snapshot_value"` } `json:"data"` Error string `json:"error"` }
---- Snapshot Value Response Types ----
type DeleteAccountResponse ¶
type DeleteBenchmarkResponse ¶
type DeleteHoldingResponse ¶
type DeleteSnapshotResponse ¶
type DeleteSnapshotValueResponse ¶
type DeleteSnapshotValueResponse struct { Data struct { Snapshot_value SnapshotValue `json:"snapshot_value"` Snapshot_total float64 `json:"snapshot_total"` Snapshot_weighteder float64 `json:"snapshot_weighteder"` Message string `json:"message"` } `json:"data"` Error string `json:"error"` }
type DeleteUserResponse ¶
type GetAccountResponse ¶
type GetAccountsResponse ¶
type GetAccountsResponse struct { Data struct { Accounts []Account `json:"accounts"` Pagination PaginationMetadata `json:"pagination"` } `json:"data"` Error string `json:"error"` }
type GetAccountsStoreOptions ¶
type GetBenchmarkResponse ¶
type GetBenchmarksResponse ¶
type GetBenchmarksResponse struct { Data struct { Benchmarks []Benchmark `json:"benchmarks"` Pagination PaginationMetadata `json:"pagination"` } `json:"data"` Error string `json:"error"` }
type GetGroupByAccountStoreOptions ¶
type GetGroupByAccountStoreOptions struct {
Group_by AccountsGroupByCategory
}
type GetGroupByHoldingStoreOptions ¶
type GetGroupByHoldingStoreOptions struct { Group_by HoldingsGroupByCategory // Omit any snapshots_values that have "skip_rebalance" set to true Omit_skip_reb bool }
type GetHoldingResponse ¶
type GetHoldingsResponse ¶
type GetHoldingsResponse struct { Data struct { Holdings []Holding `json:"holdings"` Pagination PaginationMetadata `json:"pagination"` } `json:"data"` Error string `json:"error"` }
type GetHoldingsStoreOptions ¶
type GetMeResponse ¶
type GetSettingsResponse ¶
type GetSnapshotAccountsResponse ¶
type GetSnapshotAccountsResponse struct { Data struct { Accounts_grouped ResourcesGrouped `json:"accounts_grouped"` Field_type string `json:"field_type"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotHoldingsResponse ¶
type GetSnapshotHoldingsResponse struct { Data struct { Holdings_grouped ResourcesGrouped `json:"holdings_grouped"` Field_type string `json:"field_type"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotLiquidityResponse ¶
type GetSnapshotLiquidityResponse struct { Data struct { Resources []LiquidityResource `json:"resources"` Liquid_total string `json:"liquid_total"` Field_type string `json:"field_type"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotMaturationDateResponse ¶
type GetSnapshotMaturationDateResponse struct { Data struct { Resources []MaturationDateResource `json:"resources"` Field_type string `json:"field_type"` Maturation_start string `json:"maturation_start"` Maturation_end string `json:"maturation_end"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotRebalanceResponse ¶
type GetSnapshotRebalanceResponse struct { Data struct { Target_allocation *[]AssetAllocation `json:"target_allocation"` Current_allocation *[]AssetAllocation `json:"current_allocation"` Change_required *[]AssetAllocation `json:"change_required"` Rebalance_thresh_pct int `json:"rebalance_thresh_pct"` Snapshot_total float64 `json:"snapshot_total"` Snapshot_total_omit_skips float64 `json:"snapshot_total_omit_skips"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotResponse ¶
type GetSnapshotResponse struct { Data struct { Snapshot Snapshot `json:"snapshot"` Snapshot_values []SnapshotValue `json:"snapshot_values"` Accounts []Account `json:"accounts"` Holdings []Holding `json:"holdings"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotTotalStoreOptions ¶
type GetSnapshotTotalStoreOptions struct {
Omit_skip_reb bool
}
type GetSnapshotValueResponse ¶
type GetSnapshotValueResponse struct { Data struct { Snapshot_value SnapshotValue `json:"snapshot_value"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotValuesResponse ¶
type GetSnapshotValuesResponse struct { Data struct { Snapshot_values []SnapshotValue `json:"snapshot_values"` } `json:"data"` Error string `json:"error"` }
type GetSnapshotsResponse ¶
type GetSnapshotsResponse struct { Data struct { Snapshots []Snapshot `json:"snapshots"` Pagination PaginationMetadata `json:"pagination"` } `json:"data"` Error string `json:"error"` }
type GetUserByIdResponse ¶
type GetUsersStoreOptions ¶
type Holding ¶
type Holding struct { Holding_id int `json:"holding_id,omitempty"` Name string `json:"name"` Ticker string `json:"ticker,omitempty"` Asset_category AssetCategory `json:"asset_category"` Expense_ratio_pct float32 `json:"expense_ratio_pct,omitempty"` Maturation_date string `json:"maturation_date,omitempty"` Interest_rate_pct float32 `json:"interest_rate_pct,omitempty"` Is_deprecated bool `json:"is_deprecated"` User_id int `json:"user_id"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type HoldingHandler ¶
type HoldingStore ¶
type HoldingStore interface { CreateHolding(context.Context, *Holding) (Holding, error) GetHoldings(ctx context.Context, userId int, options *GetHoldingsStoreOptions) ([]Holding, PaginationMetadata, error) GetHoldingById(ctx context.Context, userId, holdingId int) (Holding, error) GetHoldingByName(ctx context.Context, name string, userId int) (Holding, error) GetHoldingByTicker(ctx context.Context, ticker string, userId int) (Holding, error) UpdateHolding(context.Context, *Holding) (Holding, error) DeleteHolding(ctx context.Context, userId, holdingId int) (Holding, error) }
type HoldingsGroupByCategory ¶
type HoldingsGroupByCategory string
const (
BY_ASSET_CATEGORY HoldingsGroupByCategory = "ASSET_CATEGORY"
)
type LiquidityResource ¶
type LiquidityResource struct { Account_name string `json:"account_name"` Holding_name string `json:"holding_name"` Asset_category string `json:"asset_category"` Ticker string `json:"ticker"` Institution string `json:"institution"` TaxShelter string `json:"tax_shelter"` Total float64 `json:"total"` }
type LoginResponse ¶
type MaturationDateResource ¶
type MaturationDateResource struct { Account_name string `json:"account_name"` Holding_name string `json:"holding_name"` Asset_category string `json:"asset_category"` Interest_rate_pct float64 `json:"interest_rate_pct"` Maturation_date string `json:"maturation_date"` Total float64 `json:"total"` Skip_rebalance bool `json:"skip_rebalance"` }
type PaginationMetadata ¶
type PaginationQuery ¶
type PaginationQuery struct { Current_page int `json:"current_page"` Page_size int `json:"page_size"` }
func (PaginationQuery) Validate ¶
func (p PaginationQuery) Validate() error
type RegisterResponse ¶
type ResourcesGrouped ¶
type Snapshot ¶
type Snapshot struct { Snap_id int `json:"snap_id"` Description string `json:"description,omitempty"` Snap_date string `json:"snap_date"` Total float64 `json:"total"` Weighted_er_pct float64 `json:"weighted_er_pct"` Benchmark_id int `json:"benchmark_id,omitempty"` User_id int `json:"user_id"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type SnapshotHandler ¶
type SnapshotStore ¶
type SnapshotStore interface { GetSnapshots(ctx context.Context, userId int, options *GetSnapshotsStoreOptions) ([]Snapshot, PaginationMetadata, error) GetSnapshotById(ctx context.Context, snapshotId, userId int) (Snapshot, []SnapshotValue, error) CreateSnapshot(context.Context, *Snapshot) (Snapshot, error) UpdateSnapshot(context.Context, *Snapshot) (Snapshot, error) DeleteSnapshot(ctx context.Context, snapshotId, userId int) (Snapshot, error) GetSnapshotByDate(ctx context.Context, snapshotDate string, userId int) (Snapshot, error) GetSnapshotTotal(ctx context.Context, userId, snapId int, options *GetSnapshotTotalStoreOptions) (total float64, err error) RefreshSnapshotTotal(ctx context.Context, userId, snapId int) (total float64, err error) RefreshSnapshotWeightedER(ctx context.Context, userId, snapId int) (weightedER float64, err error) GroupByAccount(ctx context.Context, userId, snapId int, options *GetGroupByAccountStoreOptions) (ResourcesGrouped, error) GroupByHolding(ctx context.Context, userId, snapId int, options *GetGroupByHoldingStoreOptions) (ResourcesGrouped, error) GroupByMaturationDate(ctx context.Context, userId, snapId int, options *GetGroupByMaturationDateStoreOptions) ([]MaturationDateResource, error) GroupByLiquidity(ctx context.Context, userId, snapId int) (resources []LiquidityResource, total float64, err error) }
type SnapshotValue ¶
type SnapshotValue struct { Snap_val_id int `json:"snap_val_id"` Snap_id int `json:"snap_id"` Account_id int `json:"account_id"` Holding_id int `json:"holding_id"` Total float64 `json:"total"` Skip_rebalance bool `json:"skip_rebalance"` User_id int `json:"user_id"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type SnapshotValueHandler ¶
type SnapshotValueStore ¶
type SnapshotValueStore interface { CreateSnapshotValue(context.Context, *SnapshotValue) (SnapshotValue, error) GetSnapshotValues(ctx context.Context, snapId, userId int) ([]SnapshotValue, error) GetSnapshotValue(ctx context.Context, snapId, snapValId, userId int) (SnapshotValue, error) UpdateSnapshotValue(context.Context, *SnapshotValue) (SnapshotValue, error) DeleteSnapshotValue(ctx context.Context, snapId, snapValId, userId int) (SnapshotValue, error) }
type TaxShelter ¶
type TaxShelter = string
const ( TAXABLE TaxShelter = "TAXABLE" TRADITIONAL TaxShelter = "TRADITIONAL" ROTH TaxShelter = "ROTH" HSA TaxShelter = "HSA" FIVE_TWENTY_NINE TaxShelter = "529" )
type UpdateAccountResponse ¶
type UpdateBenchmarkResponse ¶
type UpdateHoldingResponse ¶
type UpdateSettingsResponse ¶
type UpdateSnapshotResponse ¶
type UpdateSnapshotValueResponse ¶
type UpdateSnapshotValueResponse struct { Data struct { Snapshot_value SnapshotValue `json:"snapshot_value"` Snapshot_total float64 `json:"snapshot_total"` Snapshot_weighteder float64 `json:"snapshot_weighteder"` } `json:"data"` Error string `json:"error"` }
type User ¶
type User struct { User_id int `json:"user_id,omitempty"` Email string `json:"email"` Enc_password string `json:"-"` User_role UserRole `json:"user_role"` Last_logged_in time.Time `json:"last_logged_in"` Verified bool `json:"verified"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type UserHandler ¶
type UserStore ¶
type UserStore interface { CreateUser(context.Context, *User) (User, error) GetUserById(ctx context.Context, userId int) (User, error) GetUserByEmail(ctx context.Context, email string) (User, error) GetUsers(ctx context.Context, options *GetUsersStoreOptions) ([]User, PaginationMetadata, error) UpdateUserLoggedIn(ctx context.Context, userId int) (User, error) UpdateVerification(ctx context.Context, userId int) (User, error) DeleteUser(ctx context.Context, userId int) (User, error) CreateSettings(context.Context, *Settings) (Settings, error) GetSettings(ctx context.Context, userId int) (Settings, error) UpdateSettings(context.Context, *Settings) (Settings, error) }
Click to show internal directories.
Click to hide internal directories.