service

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgSubjectFormat = "%s.%s"
	// action:bakFileName:opID:stepID
	MsgCreateBackupFormat = "%s:%s:%s:%s"
	// action:bakFileName:id
	MsgDeleteBackupFormat = "%s:%s:%s"
	// downloadDir:filename:id
	MsgStepRecoveryFormat = "%s:%s:%s"
)

Variables

This section is empty.

Functions

func HandlerCrash

func HandlerCrash()

Types

type CmdDelivery

type CmdDelivery interface {
	DeliverTaskOperation(ctx context.Context, operation *v1.Operation, opts *Options) error
	DeliverStep(ctx context.Context, operation *v1.Step, opts *Options) error
	DeliverCmd(ctx context.Context, toNode string, cmds []string, timeout time.Duration) ([]byte, error)
}

type CommonReply

type CommonReply struct {
	Error *errors.StatusError `json:"error,omitempty"`
	Data  []byte              `json:"data,omitempty"`
}

type IDelivery

type IDelivery interface {
	DeliverLogRequest(ctx context.Context, operation *LogOperation) (oplog.LogContentResponse, error) // request & response synchronously.
	CmdDelivery
}

type Interface

type Interface interface {
	Runnable
}

type LogOperation

type LogOperation struct {
	Op                Operation
	OperationIdentity string // operation ID
	To                string // the node that message will be sent to
	Timeout           time.Duration
}

type MsgPayload

type MsgPayload struct {
	Op                Operation `json:"op,omitempty"`
	OperationIdentity string    `json:"operationIdentity"`
	LastTaskReply     []byte    `json:"lastTaskReply,omitempty"`
	DryRun            bool      `json:"dryRun,omitempty"`
	Retry             bool      `json:"retry,omitempty"`
	Step              v1.Step   `json:"step,omitempty"`
	Cmds              []string  `json:"cmds,omitempty"`
}

type NodeStatusPayload

type NodeStatusPayload struct {
	Op       Operation `json:"op,omitempty"`
	NodeName string    `json:"node_name,omitempty"`
	Data     []byte    `json:"data,omitempty"`
}

type Operation

type Operation int32
const (
	OperationRegisterNode Operation = iota + 1
	OperationReportNodeStatus
	OperationGetNode
	OperationUpdateNodeLease
	OperationGetNodeLease
	OperationCreateNodeLease
	// task operation
	OperationRunTask
	OperationStepLog
	OperationBackup
	OperationRecovery
	OperationRunCmd
	OperationRunStep
)

type Options

type Options struct {
	DryRun         bool
	ForceSkipError bool
}

type Runnable

type Runnable interface {
	PrepareRun(stopCh <-chan struct{}) error
	Run(stopCh <-chan struct{}) error
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL