Documentation
¶
Index ¶
- func Run(config Config) error
- func TrySendChannel[T any](msg T, ch chan T) bool
- type AppKeyMap
- type AppModel
- type Config
- type DatasetsMsg
- type DatasetsPageModel
- type DownloadCompleteMsg
- type DownloadDesc
- type DownloadItem
- type DownloadManager
- func (dm *DownloadManager) CancelDownload(jobID string, file dbn_hist.BatchFileDesc) bool
- func (dm *DownloadManager) Close()
- func (dm *DownloadManager) Counts() (queued, active, past int)
- func (dm *DownloadManager) ProgressChannel() chan DownloadProgressMsg
- func (dm *DownloadManager) QueueDownload(jobID string, file dbn_hist.BatchFileDesc) bool
- type DownloadProgressMsg
- type DownloadProgressWriter
- type DownloadState
- type DownloadsPageKeyMap
- type DownloadsPageModel
- type FilesMsg
- type JobsMsg
- type JobsPageKeyMap
- type JobsPageModel
- type PublishersMsg
- type PublishersPageModel
- type QueueDownloadMsg
- type SchemasMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrySendChannel ¶
TrySendChannel attempts to send a msg to a channel, returning true if successful.
Types ¶
type AppKeyMap ¶
type AppKeyMap struct {
Quit key.Binding
FocusJobs key.Binding
FocusDownloads key.Binding
FocusDatasets key.Binding
FocusPublishers key.Binding
}
AppKeyMap is the all the key.Binding for the AppModel
func DefaultAppKeyMap ¶
func DefaultAppKeyMap() AppKeyMap
DefaultAppKeyMap returns a default set of key bindings for AppModel
func (*AppKeyMap) FullHelp ¶
FullHelp returns bindings to show the full help view. Implements bubble's help.KeyMap interface.
type AppModel ¶
type AppModel struct {
// contains filtered or unexported fields
}
func NewAppModel ¶
type DatasetsMsg ¶
type DatasetsPageModel ¶
type DatasetsPageModel struct {
// contains filtered or unexported fields
}
Datasets page
func NewDatasetsPage ¶
func NewDatasetsPage(config Config) DatasetsPageModel
func (DatasetsPageModel) Init ¶
func (m DatasetsPageModel) Init() tea.Cmd
Init handles the initialization of an DatasetsPageModel
func (DatasetsPageModel) View ¶
func (m DatasetsPageModel) View() string
View renders the DatasetsPageModel's view.
type DownloadCompleteMsg ¶
type DownloadCompleteMsg struct {
Desc DownloadDesc
State DownloadState
}
type DownloadDesc ¶
DownloadDesc decribes a specific download
type DownloadItem ¶
type DownloadItem struct {
Desc DownloadDesc
DestFile string
CurrentSize float64
State DownloadState
ContextCancel context.CancelFunc
}
type DownloadManager ¶
type DownloadManager struct {
// contains filtered or unexported fields
}
func NewDownloadManager ¶
func NewDownloadManager(databentoApiKey string, maxActiveDownloads int) *DownloadManager
func (*DownloadManager) CancelDownload ¶
func (dm *DownloadManager) CancelDownload(jobID string, file dbn_hist.BatchFileDesc) bool
func (*DownloadManager) Close ¶
func (dm *DownloadManager) Close()
Close closes the channels and exits the queue
func (*DownloadManager) Counts ¶
func (dm *DownloadManager) Counts() (queued, active, past int)
Counts returns the number of queued, active, and past downloads
func (*DownloadManager) ProgressChannel ¶
func (dm *DownloadManager) ProgressChannel() chan DownloadProgressMsg
func (*DownloadManager) QueueDownload ¶
func (dm *DownloadManager) QueueDownload(jobID string, file dbn_hist.BatchFileDesc) bool
QueueDownload queues a download for the specified job and file.
type DownloadProgressMsg ¶
type DownloadProgressMsg struct {
Desc DownloadDesc
CurrentSize uint64
State DownloadState
Error error
}
type DownloadProgressWriter ¶
type DownloadProgressWriter struct {
Desc DownloadDesc
CurrentSize uint64
ProgressCh chan DownloadProgressMsg
}
DownloadProgressWriter is an io.Writer that reports download progress via a channel An instance is fed to TeeWriter to track the HTTP download progress
type DownloadState ¶
type DownloadState string
const ( DownloadNone DownloadState = "" DownloadQueued DownloadState = "queued" DownloadActive DownloadState = "active" DownloadComplete DownloadState = "complete" DownloadFailed DownloadState = "failed" )
type DownloadsPageKeyMap ¶
DownloadsPageKeyMap is the all the key.Binding for the DownloadsPageModel
func DefaultDownloadsPageKeyMap ¶
func DefaultDownloadsPageKeyMap() DownloadsPageKeyMap
DefaultDownloadsPageKeyMap returns a default set of key bindings for DownloadsPageModel
func (*DownloadsPageKeyMap) FullHelp ¶
func (m *DownloadsPageKeyMap) FullHelp() [][]key.Binding
FullHelp returns bindings to show the full help view. Implements bubble's help.KeyMap interface.
func (DownloadsPageKeyMap) ShortHelp ¶
func (m DownloadsPageKeyMap) ShortHelp() []key.Binding
ShortHelp returns bindings to show in the abbreviated help view. It's part of the help.KeyMap interface.
type DownloadsPageModel ¶
type DownloadsPageModel struct {
// contains filtered or unexported fields
}
Downloads page
func NewDownloadsPage ¶
func NewDownloadsPage(config Config) DownloadsPageModel
func (DownloadsPageModel) Init ¶
func (m DownloadsPageModel) Init() tea.Cmd
Init handles the initialization of an DownloadsPageModel
func (DownloadsPageModel) View ¶
func (m DownloadsPageModel) View() string
View renders the DownloadsPageModel's view.
type FilesMsg ¶
type FilesMsg struct {
Files []dbn_hist.BatchFileDesc
Error error
}
type JobsPageKeyMap ¶
type JobsPageKeyMap struct {
NextFocus key.Binding
Download key.Binding
ToggleExpired key.Binding
ToggleDetails key.Binding
}
JobsPageKeyMap is the all the key.Binding for the JobsPageModel
func DefaultJobsPageKeyMap ¶
func DefaultJobsPageKeyMap() JobsPageKeyMap
DefaultJobsPageKeyMap returns a default set of key bindings for JobsPageModel
func (*JobsPageKeyMap) FullHelp ¶
func (m *JobsPageKeyMap) FullHelp() [][]key.Binding
FullHelp returns bindings to show the full help view. Implements bubble's help.KeyMap interface.
func (JobsPageKeyMap) ShortHelp ¶
func (m JobsPageKeyMap) ShortHelp() []key.Binding
ShortHelp returns bindings to show in the abbreviated help view. It's part of the help.KeyMap interface.
type JobsPageModel ¶
type JobsPageModel struct {
// contains filtered or unexported fields
}
Jobs page
func NewJobsPage ¶
func NewJobsPage(config Config) JobsPageModel
func (JobsPageModel) Init ¶
func (m JobsPageModel) Init() tea.Cmd
Init handles the initialization of an JobsPageModel
func (JobsPageModel) View ¶
func (m JobsPageModel) View() string
View renders the JobsPageModel's view.
type PublishersMsg ¶
type PublishersMsg struct {
Publishers []dbn_hist.PublisherDetail
Error error
}
type PublishersPageModel ¶
type PublishersPageModel struct {
// contains filtered or unexported fields
}
Publishers page
func NewPublishersPage ¶
func NewPublishersPage(config Config) PublishersPageModel
func (PublishersPageModel) Init ¶
func (m PublishersPageModel) Init() tea.Cmd
Init handles the initialization of an PublishersPageModel
func (PublishersPageModel) View ¶
func (m PublishersPageModel) View() string
View renders the PublishersPageModel's view.
type QueueDownloadMsg ¶
type QueueDownloadMsg struct {
JobID string
Files []dbn_hist.BatchFileDesc
}