Updates Containerize

This commit is contained in:
sjc
2025-05-07 23:50:46 -04:00
parent 67aa1221aa
commit 0b022d7623
9 changed files with 237 additions and 9 deletions

7
api.go
View File

@@ -14,7 +14,9 @@ const (
// TastytradeAPI represents the Tastytrade API client
type TastytradeAPI struct {
httpClient *http.Client
user string
authToken string
authExpire time.Time
remToken string
host string
}
@@ -31,6 +33,11 @@ func NewTastytradeAPI(hosts ...string) *TastytradeAPI {
}
}
// get logged in User
func (api *TastytradeAPI) User() string {
return api.user
}
// fetchData sends a GET request to the specified URL with authorization
func (api *TastytradeAPI) fetchData(url string) (map[string]interface{}, error) {
req, err := http.NewRequest("GET", url, nil)