Documentation
¶
Index ¶
- Variables
- type ApplyResult
- type CancelJobRequest
- type CancelJobResponse
- type Client
- func (c *Client) CancelJob(ctx context.Context, request entity.CancelJobRequest) (CancelJobResponse, error)
- func (c *Client) ConfirmRestartService(ctx context.Context, request RestartConfirmation) (HostRestartConfirmationResponse, error)
- func (c *Client) FeedHostConfigurationUpdate(ctx context.Context, request ConfigurationUpdateRequest) (ConfigurationUpdateResponse, error)
- func (c *Client) FeedHostRestartServiceUpdate(ctx context.Context, request HostRestartServiceUpdateRequest) (HostRestartServiceUpdateResponse, error)
- func (c *Client) SubmitJob(ctx context.Context, request entity.SubmitDeploymentJobRequest) (SubmitJobResponse, error)
- type Command
- type CommandWrapper
- type CommonResponse
- type ConfigurationUpdateRequest
- type ConfigurationUpdateResponse
- type EventAllHostConfigured
- type EventAllServiceRestarted
- type EventDeploymentJobCancelled
- type EventDeploymentJobCreated
- type EventDeploymentJobFailed
- type EventDeploymentJobSuccess
- type EventHostConfigurationUpdate
- type EventHostConfigured
- type EventRestartConfirmed
- type EventServiceRestartUpdate
- type EventServiceRestarted
- type HostRestartConfirmationResponse
- type HostRestartServiceUpdateRequest
- type HostRestartServiceUpdateResponse
- type RaftApp
- func (m *RaftApp) GetJobLatestUsecase() *mycontent_base.Handler[*entity.DeploymentJob]
- func (m *RaftApp) GetJobStore() *mycontent_base.Handler[*entity.DeploymentJob]
- func (m *RaftApp) GetSuccessfulJobStore() *mycontent_base.Handler[*entity.DeploymentJobByService]
- func (m *RaftApp) OnUpdateV2(ctx context.Context, entry raft.EntryV2) (any, error)
- type RestartConfirmation
- type SubmitJobResponse
- type SubmitJobStatus
Constants ¶
This section is empty.
Variables ¶
var ErrRetryable = errors.New("retryable")
ErrRetryable crashes the state machine to preserve state invariant
Functions ¶
This section is empty.
Types ¶
type ApplyResult ¶
type CancelJobRequest ¶
type CancelJobResponse ¶
type CancelJobResponse entity.DeploymentJob
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelJob ¶
func (c *Client) CancelJob(ctx context.Context, request entity.CancelJobRequest) (CancelJobResponse, error)
func (*Client) ConfirmRestartService ¶
func (c *Client) ConfirmRestartService(ctx context.Context, request RestartConfirmation) (HostRestartConfirmationResponse, error)
func (*Client) FeedHostConfigurationUpdate ¶
func (c *Client) FeedHostConfigurationUpdate(ctx context.Context, request ConfigurationUpdateRequest) (ConfigurationUpdateResponse, error)
func (*Client) FeedHostRestartServiceUpdate ¶
func (c *Client) FeedHostRestartServiceUpdate(ctx context.Context, request HostRestartServiceUpdateRequest) (HostRestartServiceUpdateResponse, error)
func (*Client) SubmitJob ¶
func (c *Client) SubmitJob(ctx context.Context, request entity.SubmitDeploymentJobRequest) (SubmitJobResponse, error)
type Command ¶
type Command string
const ( TableDeploymentJob = "deploy_job__deployment_job" TableDeploymentSuccess = "deploy_job__deployment_success" CommandUserSubmitJob Command = "deployd.user.submit-job" CommandUserCancelJob Command = "deployd.user.cancel-job" // Host update CommandHostConfigurationUpdate Command = "deployd.host.configuration-update" // After configured, we wait before immediately continuing CommandRestartConfirmation Command = "deployd.restart-confirmation" // Update de CommandHostRestartServiceUpdate Command = "deployd.host.restart-service-update" )
type CommandWrapper ¶
type CommonResponse ¶
type CommonResponse struct {
TriggerHost string `json:"trigger_host"`
Job entity.DeploymentJob `json:"job"`
Failed bool `json:"failed,omitempty"`
FailReason *string `json:"fail_reason,omitempty"`
}
type ConfigurationUpdateRequest ¶
type ConfigurationUpdateRequest struct {
Ns string `json:"namespace"`
JobId string `json:"job_id"`
Service string `json:"service"`
HostName string `json:"host_name"`
Status entity.HostConfigurationStatus `json:"status"`
ErrorMessage *string `json:"error_message,omitempty"`
URL string `json:"url"`
UpdatedAt time.Time `json:"updated_at"`
}
type ConfigurationUpdateResponse ¶
type ConfigurationUpdateResponse CommonResponse
type EventAllHostConfigured ¶
type EventAllHostConfigured ConfigurationUpdateResponse
type EventAllServiceRestarted ¶
type EventAllServiceRestarted HostRestartServiceUpdateResponse
type EventDeploymentJobCancelled ¶
type EventDeploymentJobCancelled struct {
Job entity.DeploymentJob
}
type EventDeploymentJobCreated ¶
type EventDeploymentJobCreated SubmitJobResponse
type EventDeploymentJobFailed ¶
type EventDeploymentJobFailed CommonResponse
type EventDeploymentJobSuccess ¶
type EventDeploymentJobSuccess CommonResponse
type EventHostConfigurationUpdate ¶
type EventHostConfigurationUpdate ConfigurationUpdateResponse
type EventHostConfigured ¶
type EventHostConfigured ConfigurationUpdateResponse
type EventRestartConfirmed ¶
type EventRestartConfirmed HostRestartConfirmationResponse
Lets go deploy
type EventServiceRestartUpdate ¶
type EventServiceRestartUpdate HostRestartServiceUpdateResponse
type EventServiceRestarted ¶
type EventServiceRestarted HostRestartServiceUpdateResponse
type HostRestartServiceUpdateRequest ¶
type HostRestartServiceUpdateRequest struct {
Ns string `json:"namespace"`
JobId string `json:"job_id"`
Service string `json:"service"`
HostName string `json:"host_name"`
Status entity.HostRestartServiceStatus `json:"status"`
ErrorMessage *string `json:"message,omitempty"`
Order *int `json:"order"`
URL string `json:"url"`
UpdatedAt time.Time `json:"updated_at"`
}
type HostRestartServiceUpdateResponse ¶
type HostRestartServiceUpdateResponse struct {
CommonResponse
Step int `json:"current_step"`
}
type RaftApp ¶ added in v0.0.2
type RaftApp struct {
// contains filtered or unexported fields
}
RaftApp / coordinator
An example to do raft application's composition (aka. inheritance). It extends the existing "ContentApp" implementation with our business logic. If you have multiple, you can use actual composition instead, and then make sure the Raft App lifecycle is executed for each instance
func (*RaftApp) GetJobLatestUsecase ¶ added in v0.0.2
func (m *RaftApp) GetJobLatestUsecase() *mycontent_base.Handler[*entity.DeploymentJob]
func (*RaftApp) GetJobStore ¶ added in v0.0.2
func (m *RaftApp) GetJobStore() *mycontent_base.Handler[*entity.DeploymentJob]
func (*RaftApp) GetSuccessfulJobStore ¶ added in v0.0.2
func (m *RaftApp) GetSuccessfulJobStore() *mycontent_base.Handler[*entity.DeploymentJobByService]
type RestartConfirmation ¶
type SubmitJobResponse ¶
type SubmitJobResponse struct {
SubmitJobStatus SubmitJobStatus `json:"submit_job_status,omitempty"` // Ephemeral field, only populated after job reply
Job entity.DeploymentJob `json:"job"`
}
type SubmitJobStatus ¶
type SubmitJobStatus string
const ( SubmitJobStatusNeedRetry SubmitJobStatus = "NEED_RETRY" SubmitJobStatusSuccess SubmitJobStatus = "SUCCESS" )