etradelib

package
v0.0.0-...-2ad8316 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DeleteAlertsStatusKey is the key for the status
	DeleteAlertsStatusKey = "status"

	// DeleteAlertsErrorKey is the key for the error message
	DeleteAlertsErrorKey = "error"

	// DeleteAlertsFailedAlertsKey is the key for a slice of failed
	// alert IDs
	DeleteAlertsFailedAlertsKey = "failedAlerts"
)
View Source
const (

	// OptionChainPairListOptionChainPairsPath is the path to a slice of optionChainPairs.
	OptionChainPairListOptionChainPairsPath = ".optionChainPairs"

	// OptionChainPairListTimeStampPath is the path to timestamp.
	OptionChainPairListTimeStampPath = ".timeStamp"

	// OptionChainPairListQuoteTypePath is the path to quote type.
	OptionChainPairListQuoteTypePath = ".quoteType"

	// OptionChainPairListNearPricePath is the path to near price.
	OptionChainPairListNearPricePath = ".nearPrice"

	// OptionChainPairListSelectedEDPath is the path to selectedED map.
	OptionChainPairListSelectedEDPath = ".selectedED"
)
View Source
const (

	// PositionsListPositionsPath is the path to a slice of positions.
	PositionsListPositionsPath = ".positions"

	// PositionsListTotalsPath is the path to a map of totals info
	PositionsListTotalsPath = ".totals"
)
View Source
const (

	// QuoteListQuotesPath is the path to a slice of quotes.
	QuoteListQuotesPath = ".quotes"

	// QuoteListMessagesPath is the path to a slice of messages.
	QuoteListMessagesPath = ".messages"
)
View Source
const (

	// AccountsListAccountsPath is the path to a slice of accounts.
	AccountsListAccountsPath = "accounts"
)
View Source
const (

	// AlertListAlertsPath is the path to a slice of alerts.
	AlertListAlertsPath = ".alerts"
)
View Source
const (

	// LookupResultListResultsPath is the path to a slice of lookup results.
	LookupResultListResultsPath = ".results"
)
View Source
const (

	// OptionExpireDateListOptionExpireDatesPath is the path to a slice of optionExpireDates.
	OptionExpireDateListOptionExpireDatesPath = ".optionExpireDates"
)
View Source
const (

	// OrderListOrdersPath is the path to a slice of
	// orders.
	OrderListOrdersPath = ".orders"
)
View Source
const (

	// PositionLotsPath is the path to a slice of lots for the position.
	PositionLotsPath = ".lots"
)
View Source
const (

	// TransactionListTransactionsPath is the path to a slice of transactions.
	TransactionListTransactionsPath = ".transactions"
)

Variables

This section is empty.

Functions

func NewNormalizedJsonMap

func NewNormalizedJsonMap(responseBytes []byte) (jsonmap.JsonMap, error)

NewNormalizedJsonMap returns a JsonMap representation of a JSON response from the ETrade API. It normalizes all keys in the returned map so that their first letter is lower-case. ETrade's keys are camel-cased; however, some keys are UpperCamelCase and some are lowerCamelCase. Because map keys are case-sensitive, normalizing them to lowerCamelCase helps avoid issues indexing the map.

Completely lower-casing the keys would help with other inconsistencies in ETrade's camel-casing; however, doing so would hurt key readability. The normalization should result in mostly-consistent lowerCamelCase keys, where the remaining inconsistencies stem from ETrade's choice of word boundaries (e.g. lowerCamelCase vs lowerCamelcase).

Types

type ETradeAccount

type ETradeAccount interface {
	GetId() string
	GetIdKey() string
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAccount

func CreateETradeAccount(id string, idKey string, jsonMap jsonmap.JsonMap) ETradeAccount

func CreateETradeAccountFromMap

func CreateETradeAccountFromMap(responseMap jsonmap.JsonMap) (ETradeAccount, error)

type ETradeAccountList

type ETradeAccountList interface {
	GetAllAccounts() []ETradeAccount
	GetAccountById(accountID string) ETradeAccount
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAccountList

func CreateETradeAccountList(responseMap jsonmap.JsonMap) (ETradeAccountList, error)

func CreateETradeAccountListFromResponse

func CreateETradeAccountListFromResponse(response []byte) (ETradeAccountList, error)

type ETradeAlert

type ETradeAlert interface {
	GetId() int64
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAlert

func CreateETradeAlert(responseMap jsonmap.JsonMap) (ETradeAlert, error)

type ETradeAlertDetails

type ETradeAlertDetails interface {
	GetId() int64
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAlertDetails

func CreateETradeAlertDetails(responseMap jsonmap.JsonMap) (ETradeAlertDetails, error)

func CreateETradeAlertDetailsFromResponse

func CreateETradeAlertDetailsFromResponse(response []byte) (ETradeAlertDetails, error)

type ETradeAlertList

type ETradeAlertList interface {
	GetAllAlerts() []ETradeAlert
	GetAlertById(alertID int64) ETradeAlert
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAlertList

func CreateETradeAlertList(responseMap jsonmap.JsonMap) (ETradeAlertList, error)

func CreateETradeAlertListFromResponse

func CreateETradeAlertListFromResponse(response []byte) (ETradeAlertList, error)

type ETradeAuthenticationStatus

type ETradeAuthenticationStatus interface {
	NeedAuthorization() bool
	GetAuthorizationUrl() string
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeAuthenticationStatus

func CreateETradeAuthenticationStatus(responseMap jsonmap.JsonMap) (
	ETradeAuthenticationStatus, error,
)

func CreateETradeAuthenticationStatusFromResponse

func CreateETradeAuthenticationStatusFromResponse(response []byte) (ETradeAuthenticationStatus, error)

type ETradeBalances

type ETradeBalances interface {
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeBalances

func CreateETradeBalances(responseMap jsonmap.JsonMap) (ETradeBalances, error)

func CreateETradeBalancesFromResponse

func CreateETradeBalancesFromResponse(response []byte) (ETradeBalances, error)

type ETradeDeleteAlerts

type ETradeDeleteAlerts interface {
	IsSuccess() bool
	GetFailedAlerts() []int64
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeDeleteAlerts

func CreateETradeDeleteAlerts(responseMap jsonmap.JsonMap) (ETradeDeleteAlerts, error)

func CreateETradeDeleteAlertsFromResponse

func CreateETradeDeleteAlertsFromResponse(response []byte) (ETradeDeleteAlerts, error)

type ETradeLookupResult

type ETradeLookupResult interface {
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeLookupResult

func CreateETradeLookupResult(responseMap jsonmap.JsonMap) (ETradeLookupResult, error)

type ETradeLookupResultList

type ETradeLookupResultList interface {
	GetAllResults() []ETradeLookupResult
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeLookupResultList

func CreateETradeLookupResultList(responseMap jsonmap.JsonMap) (ETradeLookupResultList, error)

func CreateETradeLookupResultListFromResponse

func CreateETradeLookupResultListFromResponse(response []byte) (ETradeLookupResultList, error)

type ETradeOptionChainPair

type ETradeOptionChainPair interface {
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOptionChainPair

func CreateETradeOptionChainPair(responseMap jsonmap.JsonMap) (ETradeOptionChainPair, error)

type ETradeOptionChainPairList

type ETradeOptionChainPairList interface {
	GetAllOptionChainPairs() []ETradeOptionChainPair
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOptionChainPairList

func CreateETradeOptionChainPairList(responseMap jsonmap.JsonMap) (ETradeOptionChainPairList, error)

func CreateETradeOptionChainPairListFromResponse

func CreateETradeOptionChainPairListFromResponse(response []byte) (ETradeOptionChainPairList, error)

type ETradeOptionExpireDate

type ETradeOptionExpireDate interface {
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOptionExpireDate

func CreateETradeOptionExpireDate(responseMap jsonmap.JsonMap) (ETradeOptionExpireDate, error)

type ETradeOptionExpireDateList

type ETradeOptionExpireDateList interface {
	GetAllOptionExpireDates() []ETradeOptionExpireDate
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOptionExpireDateList

func CreateETradeOptionExpireDateList(responseMap jsonmap.JsonMap) (ETradeOptionExpireDateList, error)

func CreateETradeOptionExpireDateListFromResponse

func CreateETradeOptionExpireDateListFromResponse(response []byte) (ETradeOptionExpireDateList, error)

type ETradeOrder

type ETradeOrder interface {
	GetId() int64
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOrder

func CreateETradeOrder(responseMap jsonmap.JsonMap) (ETradeOrder, error)

type ETradeOrderList

type ETradeOrderList interface {
	GetAllOrders() []ETradeOrder
	GetOrderById(orderID int64) ETradeOrder
	NextPage() string
	AddPage(responseMap jsonmap.JsonMap) error
	AddPageFromResponse(response []byte) error
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeOrderList

func CreateETradeOrderList(responseMap jsonmap.JsonMap) (ETradeOrderList, error)

func CreateETradeOrderListFromResponse

func CreateETradeOrderListFromResponse(response []byte) (
	ETradeOrderList, error,
)

type ETradePosition

type ETradePosition interface {
	GetId() int64
	AddLots(responseMap jsonmap.JsonMap) error
	AddLotsFromResponse(response []byte) error
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradePosition

func CreateETradePosition(responseMap jsonmap.JsonMap) (ETradePosition, error)

type ETradePositionList

type ETradePositionList interface {
	GetAllPositions() []ETradePosition
	GetPositionById(positionID int64) ETradePosition
	NextPage() string
	AddPage(responseMap jsonmap.JsonMap) error
	AddPageFromResponse(response []byte) error
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradePositionList

func CreateETradePositionList(responseMap jsonmap.JsonMap) (ETradePositionList, error)

func CreateETradePositionListFromResponse

func CreateETradePositionListFromResponse(response []byte) (ETradePositionList, error)

type ETradeQuote

type ETradeQuote interface {
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeQuote

func CreateETradeQuote(responseMap jsonmap.JsonMap) (ETradeQuote, error)

type ETradeQuoteList

type ETradeQuoteList interface {
	GetAllQuotes() []ETradeQuote
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeQuoteList

func CreateETradeQuoteList(responseMap jsonmap.JsonMap) (ETradeQuoteList, error)

func CreateETradeQuoteListFromResponse

func CreateETradeQuoteListFromResponse(response []byte) (ETradeQuoteList, error)

type ETradeStatus

type ETradeStatus interface {
	IsSuccess() bool
	GetErrorMessage() string
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeStatus

func CreateETradeStatus(responseMap jsonmap.JsonMap) (
	ETradeStatus, error,
)

func CreateETradeStatusFromResponse

func CreateETradeStatusFromResponse(response []byte) (ETradeStatus, error)

type ETradeTransaction

type ETradeTransaction interface {
	GetId() string
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeTransaction

func CreateETradeTransaction(responseMap jsonmap.JsonMap) (ETradeTransaction, error)

type ETradeTransactionDetails

type ETradeTransactionDetails interface {
	GetId() int64
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeTransactionDetails

func CreateETradeTransactionDetails(responseMap jsonmap.JsonMap) (ETradeTransactionDetails, error)

func CreateETradeTransactionDetailsFromResponse

func CreateETradeTransactionDetailsFromResponse(response []byte) (ETradeTransactionDetails, error)

type ETradeTransactionList

type ETradeTransactionList interface {
	GetAllTransactions() []ETradeTransaction
	GetTransactionById(transactionID string) ETradeTransaction
	NextPage() string
	AddPage(responseMap jsonmap.JsonMap) error
	AddPageFromResponse(response []byte) error
	AsJsonMap() jsonmap.JsonMap
}

func CreateETradeTransactionList

func CreateETradeTransactionList(responseMap jsonmap.JsonMap) (ETradeTransactionList, error)

func CreateETradeTransactionListFromResponse

func CreateETradeTransactionListFromResponse(response []byte) (
	ETradeTransactionList, error,
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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