Documentation ¶
Index ¶
- Variables
- type CreateFailed
- type Datastore
- func (d *Datastore) Batch(ctx context.Context) (datastore.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(ctx context.Context, key datastore.Key) error
- func (d *Datastore) Get(ctx context.Context, key datastore.Key) (value []byte, err error)
- func (d *Datastore) GetSize(ctx context.Context, key datastore.Key) (size int, err error)
- func (d *Datastore) Has(ctx context.Context, key datastore.Key) (exists bool, err error)
- func (d *Datastore) Put(ctx context.Context, key datastore.Key, value []byte) error
- func (d *Datastore) Query(ctx context.Context, q query.Query) (query.Results, error)
- func (d *Datastore) Sync(ctx context.Context, prefix datastore.Key) error
- type DeployFailed
- type DeployRequestSent
- type DeployResult
- type DeploySucceed
- type Ignorable
- type Manager
- func (m *Manager) CheckProjectReplicasFromNode(nodeID string)
- func (m *Manager) Delete(req *types.ProjectReq) error
- func (m *Manager) Deploy(req *types.DeployProjectReq) error
- func (m *Manager) GetProjectInfo(uuid string) (*types.ProjectInfo, error)
- func (m *Manager) ListProjects() ([]ProjectInfo, error)
- func (m *Manager) Plan(events []statemachine.Event, user interface{}) (interface{}, uint64, error)
- func (m *Manager) RestartDeployProjects(ids []string) error
- func (m *Manager) StartTimer(ctx context.Context)
- func (m *Manager) Terminate(ctx context.Context) error
- func (m *Manager) Update(req *types.ProjectReq) error
- func (m *Manager) UpdateStatus(nodeID string, list []*types.Project) error
- type ProjectForceState
- type ProjectID
- type ProjectInfo
- type ProjectRedeploy
- type ProjectRestart
- type ProjectState
- type SkipStep
- type UpdateFailed
- type UpdateRequestSent
Constants ¶
This section is empty.
Variables ¶
var ( // MinRetryTime defines the minimum time duration between retries MinRetryTime = 30 * time.Second // MaxRetryCount defines the maximum number of retries allowed MaxRetryCount = 1 )
Functions ¶
This section is empty.
Types ¶
type CreateFailed ¶
type CreateFailed struct {
// contains filtered or unexported fields
}
CreateFailed indicates that node selection has failed
func (CreateFailed) FormatError ¶
func (evt CreateFailed) FormatError(xerrors.Printer) (next error)
FormatError Format error
type Datastore ¶
Datastore represents the project datastore
func NewDatastore ¶
NewDatastore creates a new projectDatastore
type DeployFailed ¶
type DeployFailed struct {
// contains filtered or unexported fields
}
DeployFailed indicates that a node has failed to pull an project
func (DeployFailed) FormatError ¶
func (evt DeployFailed) FormatError(xerrors.Printer) (next error)
FormatError Format error
func (DeployFailed) Ignore ¶
func (evt DeployFailed) Ignore()
type DeployRequestSent ¶
type DeployRequestSent struct{}
DeployRequestSent indicates that a pull request has been sent
type DeployResult ¶
DeployResult represents the result of node starting
func (DeployResult) Ignore ¶
func (evt DeployResult) Ignore()
type DeploySucceed ¶
type DeploySucceed struct{}
DeploySucceed indicates that a node has successfully pulled an project
func (DeploySucceed) Ignore ¶
func (evt DeploySucceed) Ignore()
type Manager ¶
Manager manages project replicas
func NewManager ¶
NewManager returns a new projectManager instance
func (*Manager) CheckProjectReplicasFromNode ¶
func (*Manager) GetProjectInfo ¶
func (m *Manager) GetProjectInfo(uuid string) (*types.ProjectInfo, error)
func (*Manager) ListProjects ¶
func (m *Manager) ListProjects() ([]ProjectInfo, error)
ListProjects load project pull infos from state machine
func (*Manager) RestartDeployProjects ¶
RestartDeployProjects restarts deploy projects
func (*Manager) StartTimer ¶
Start initializes and starts the project state machine and associated tickers
type ProjectForceState ¶
type ProjectForceState struct { State ProjectState Details string NodeIDs []string Event int64 }
ProjectForceState forces an project state
type ProjectInfo ¶
type ProjectInfo struct { // uuid UUID ProjectID State ProjectState Name string BundleURL string Replicas int64 CPUCores int64 Memory int64 AreaID string UserID string DetailsList []string EdgeReplicaSucceeds []string EdgeWaitings int64 RetryCount int64 ReplenishReplicas int64 NodeIDs []string Event int64 }
ProjectInfo
func (*ProjectInfo) MarshalCBOR ¶
func (t *ProjectInfo) MarshalCBOR(w io.Writer) error
func (*ProjectInfo) ToProjectInfo ¶
func (state *ProjectInfo) ToProjectInfo() *types.ProjectInfo
ToProjectInfo converts ProjectInfo to types.ProjectInfo
func (*ProjectInfo) UnmarshalCBOR ¶
func (t *ProjectInfo) UnmarshalCBOR(r io.Reader) (err error)
type ProjectRedeploy ¶
type ProjectRedeploy struct{}
ProjectRedeploy re-pull the project
func (ProjectRedeploy) Ignore ¶
func (evt ProjectRedeploy) Ignore()
type ProjectState ¶
type ProjectState string
const ( NodeSelect ProjectState = "NodeSelect" Update ProjectState = "Update" Deploying ProjectState = "Deploying" Servicing ProjectState = "Servicing" Failed ProjectState = "Failed" Remove ProjectState = "Remove" )
type UpdateFailed ¶
type UpdateFailed struct {
// contains filtered or unexported fields
}
UpdateFailed indicates that node selection has failed
func (UpdateFailed) FormatError ¶
func (evt UpdateFailed) FormatError(xerrors.Printer) (next error)
FormatError Format error
type UpdateRequestSent ¶
type UpdateRequestSent struct{}
UpdateRequestSent indicates that a pull request has been sent