Documentation
¶
Index ¶
- type CountWorkersResponse
- type Manager
- func (m *Manager) CountWorkers(ctx context.Context, master string) (*CountWorkersResponse, error)
- func (m *Manager) CreateWorker(ctx context.Context, master string, status Status) (*model.WorkerAccount, error)
- func (m *Manager) GetMaster(ctx context.Context, keepShareUserID string) (*model.MasterAccount, error)
- func (m *Manager) GetWorkerWithEnoughCapacity(ctx context.Context, master string, size int64, status Status) (*model.WorkerAccount, error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountWorkersResponse ¶
type CountWorkersResponse struct { Premium countWorkersData `json:"premium"` Free countWorkersData `json:"free"` }
CountWorkersResponse is the result.
type Manager ¶
type Manager struct { *hosts.Dependencies // contains filtered or unexported fields }
Manager accounts.
func NewManager ¶
NewManager returns a manager instance.
func (*Manager) CountWorkers ¶
CountWorkers counts total workers info for the master.
func (*Manager) CreateWorker ¶
func (*Manager) GetMaster ¶
func (m *Manager) GetMaster(ctx context.Context, keepShareUserID string) (*model.MasterAccount, error)
GetMaster get bound account, if not found, create a master account and bind to this user.
func (*Manager) GetWorkerWithEnoughCapacity ¶
func (m *Manager) GetWorkerWithEnoughCapacity(ctx context.Context, master string, size int64, status Status) (*model.WorkerAccount, error)
GetWorkerWithEnoughCapacity get or create a worker account with sufficient capacity and with the smallest remaining capacity.
Click to show internal directories.
Click to hide internal directories.