2022-04-13 16:47:42 +00:00
|
|
|
package common
|
|
|
|
|
|
2022-04-23 13:05:40 +00:00
|
|
|
import "runner-manager/params"
|
|
|
|
|
|
2022-04-27 16:56:28 +00:00
|
|
|
type PoolType string
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
RepositoryPool PoolType = "repository"
|
|
|
|
|
OrganizationPool PoolType = "organization"
|
|
|
|
|
)
|
|
|
|
|
|
2022-04-23 13:05:40 +00:00
|
|
|
type PoolManager interface {
|
|
|
|
|
WebhookSecret() string
|
|
|
|
|
HandleWorkflowJob(job params.WorkflowJob) error
|
2022-04-29 14:18:22 +00:00
|
|
|
RefreshState(cfg params.Repository) error
|
2022-04-26 20:29:58 +00:00
|
|
|
|
|
|
|
|
// PoolManager lifecycle functions. Start/stop pool.
|
|
|
|
|
Start() error
|
|
|
|
|
Stop() error
|
|
|
|
|
Wait() error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Pool interface {
|
2022-04-23 13:05:40 +00:00
|
|
|
ListInstances() ([]params.Instance, error)
|
|
|
|
|
GetInstance() (params.Instance, error)
|
|
|
|
|
DeleteInstance() error
|
|
|
|
|
StopInstance() error
|
|
|
|
|
StartInstance() error
|
|
|
|
|
|
|
|
|
|
// Pool lifecycle functions. Start/stop pool.
|
|
|
|
|
Start() error
|
|
|
|
|
Stop() error
|
|
|
|
|
Wait() error
|
|
|
|
|
}
|