31 lines
401 B
Go
31 lines
401 B
Go
package plays
|
|
|
|
import (
|
|
"time"
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
"github.com/go-resty/resty/v2"
|
|
)
|
|
|
|
const (
|
|
tick = 100 * time.Millisecond
|
|
)
|
|
|
|
type TickMsg time.Time
|
|
|
|
func Tick() tea.Cmd {
|
|
return tea.Tick(tick, func(t time.Time) tea.Msg {
|
|
return TickMsg(t)
|
|
})
|
|
}
|
|
|
|
type Base struct {
|
|
client *resty.Client
|
|
}
|
|
|
|
func NewBase(client *resty.Client) *Base {
|
|
return &Base{
|
|
client: client,
|
|
}
|
|
}
|