── App model ─────────────────────────────────────────────────────────────────
| 56 | // ── App model ───────────────────────────────────────────────────────────────── |
| 57 | |
| 58 | type App struct { |
| 59 | version string |
| 60 | width int |
| 61 | height int |
| 62 | |
| 63 | viewMode ViewMode |
| 64 | authState AuthState |
| 65 | errorMsg string |
| 66 | |
| 67 | client *api.Client |
| 68 | db *db.DB |
| 69 | |
| 70 | pricingView *views.PricingView |
| 71 | historyView *views.HistoryView |
| 72 | settingsView *views.SettingsView |
| 73 | |
| 74 | // pending pricing cache params for saving to DB |
| 75 | pendingCacheProducts []string |
| 76 | pendingCacheRegions []string |
| 77 | pendingCacheAttrs map[string]string |
| 78 | pendingCachePrices []string |
| 79 | |
| 80 | loadingFrame int |
| 81 | metadataRefreshMsg string |
| 82 | refreshMsgFrames int |
| 83 | |
| 84 | // token info for auth polling |
| 85 | exchangeCode string |
| 86 | } |
| 87 | |
| 88 | func NewApp(version string) (*App, error) { |
| 89 | client, err := api.New() |
nothing calls this directly
no outgoing calls
no test coverage detected