Documentation ¶
Index ¶
- Variables
- func CheckStop(ctx context.Context) error
- type AppEvent
- type AppState
- type Application
- func (a *Application) CheckUpdates(ctx *Context) error
- func (a *Application) CompleteCheckUpdates(ctx *Context, build string) error
- func (a *Application) Event() AppEvent
- func (a *Application) GetLastPlayed() int64
- func (a *Application) Install(ctx *Context, branch, build, path string, autoUpdate bool) error
- func (a *Application) Launch(ctx *Context) error
- func (a *Application) Launched(ctx *Context) error
- func (a *Application) NewBuild(ctx *Context, branch, build string) error
- func (a *Application) Recover(ctx *Context) error
- func (a *Application) SetAutoUpdate(ctx *Context, value bool) error
- func (a *Application) Stopped(ctx *Context) error
- func (a *Application) SwitchBranch(ctx *Context, branch, build string) error
- func (a *Application) Uninstall(ctx *Context) error
- func (a *Application) Update(ctx *Context) error
- func (a *Application) Verify(ctx *Context) error
- type Apps
- type Command
- type CommandFunc
- type Context
- type DB
- type Executor
- func (e *Executor) Add(ctx *Context, t *Task) error
- func (e *Executor) ChangePriority(ctx *Context, id int64, priority int) error
- func (e *Executor) Find(id int64) (*Task, error)
- func (e *Executor) GetAll() []UpdateTaskEvent
- func (e *Executor) Remove(ctx *Context, id int64) error
- func (e *Executor) Run(j SimpleJob)
- type FakeJob
- type IntIDProvider
- type Job
- type JobFactory
- type Listener
- type PerfStats
- type PerfStatsEvent
- type ProcessState
- type QueueOrderEvent
- type Runner
- type SimpleJob
- type Task
- type TaskState
- type TaskType
- type TypeWriter
- type UpdateTaskEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var SMOOTHING_FACTOR = 0.3
Functions ¶
Types ¶
type Application ¶
type Application struct { ID string State AppState Path string Branch string Build string AutoUpdate bool UpdateAvailable bool UpdateBuild string LastLaunched int64 TotalPlayed time.Duration LastPlayed int64 // contains filtered or unexported fields }
func NewApp ¶
func NewApp(id string) *Application
func (*Application) CheckUpdates ¶
func (a *Application) CheckUpdates(ctx *Context) error
func (*Application) CompleteCheckUpdates ¶
func (a *Application) CompleteCheckUpdates(ctx *Context, build string) error
func (*Application) Event ¶
func (a *Application) Event() AppEvent
func (*Application) GetLastPlayed ¶
func (a *Application) GetLastPlayed() int64
func (*Application) Install ¶
func (a *Application) Install(ctx *Context, branch, build, path string, autoUpdate bool) error
func (*Application) Launch ¶
func (a *Application) Launch(ctx *Context) error
func (*Application) Launched ¶
func (a *Application) Launched(ctx *Context) error
func (*Application) NewBuild ¶
func (a *Application) NewBuild(ctx *Context, branch, build string) error
func (*Application) Recover ¶
func (a *Application) Recover(ctx *Context) error
func (*Application) SetAutoUpdate ¶
func (a *Application) SetAutoUpdate(ctx *Context, value bool) error
func (*Application) Stopped ¶
func (a *Application) Stopped(ctx *Context) error
func (*Application) SwitchBranch ¶
func (a *Application) SwitchBranch(ctx *Context, branch, build string) error
func (*Application) Uninstall ¶
func (a *Application) Uninstall(ctx *Context) error
func (*Application) Update ¶
func (a *Application) Update(ctx *Context) error
func (*Application) Verify ¶
func (a *Application) Verify(ctx *Context) error
type Apps ¶
type Apps map[string]*Application
Apps is application registry
func (Apps) Add ¶
func (s Apps) Add(app *Application) error
func (Apps) FindOrNew ¶
func (s Apps) FindOrNew(id string) *Application
type CommandFunc ¶
func (CommandFunc) Apply ¶
func (f CommandFunc) Apply(ctx *Context) error
type Context ¶
type Context struct { DB DB Apps Apps Executor *Executor // contains filtered or unexported fields }
func NewContext ¶
func NewContext(db DB, f JobFactory) (*Context, error)
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor() *Executor
func (*Executor) ChangePriority ¶
func (*Executor) GetAll ¶
func (e *Executor) GetAll() []UpdateTaskEvent
type IntIDProvider ¶
type IntIDProvider int64
func (*IntIDProvider) NextID ¶
func (p *IntIDProvider) NextID() int64
type JobFactory ¶
type JobFactory interface { NewJob(kind TaskType, app *Application, recover bool) Job NewCheckUpdate(ctx *Context, app *Application) SimpleJob NewLaunch(ctx *Context, app *Application) SimpleJob }
type PerfStatsEvent ¶
type ProcessState ¶
type ProcessState byte
const ( PStopped ProcessState = iota PRunning PStopping )
type QueueOrderEvent ¶
type QueueOrderEvent struct {
Tasks []int64
}
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (Runner) RunFunc ¶
func (r Runner) RunFunc(f CommandFunc) error
func (Runner) Unsubscribe ¶
type Task ¶
type Task struct { ID int64 App *Application Type TaskType State TaskState Progress process.Progress Error error // contains filtered or unexported fields }
func RecoverTask ¶
func RecoverTask(ctx *Context, app *Application, kind TaskType) *Task
type TypeWriter ¶
type TypeWriter struct {
// contains filtered or unexported fields
}
func (TypeWriter) String ¶
func (t TypeWriter) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.