types

package
v0.0.0-...-8199b78 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseTypeSucceeded = iota
	ResponseTypeFailed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LockRequest

type LockRequest struct {
	NodeID  uint          `json:"node_id"`
	TimeOut time.Duration `json:"timeout"`
}

LockRequest locks acquire the central lock

type LockResponse

type LockResponse struct {
	Result     ResponseType `json:"result"`
	OccupiedBy uint         `json:"occupied_by"`
}

type NodeRegisterResponse

type NodeRegisterResponse struct {
	NodeID uint `json:"node_id"`
}

NodeRegisterResponse set a NodeID for every syncd node at present

type ResponseType

type ResponseType int

type SyncType

type SyncType int
const (
	//DefaultSync task syncs the image meta data and layer data to remote dir
	DefaultSync SyncType = iota
	//DirStructureSync build the dir structure for the remote dir
	DirStructureSync
)

type TaskRegisterRequest

type TaskRegisterRequest struct {
	NodeID        uint     `json:"node_id"`
	TaskSpecifier string   `json:"task_specifier"`
	Type          SyncType `json:"type"`
}

TaskRegisterRequest send by syncd to register a sync tack

type TaskRegisterResponse

type TaskRegisterResponse struct {
	Result     ResponseType `json:"result"`
	TaskStatus TaskStatus   `json:"task_status"`
	NodeID     uint         `json:"node_id"`
	Msg        string       `json:"msg"`
}

TaskRegisterResponse represents the register response

type TaskStatus

type TaskStatus int
const (
	TaskStatusUnknown TaskStatus = iota
	TaskStatusRunning
	TaskStatusFinished
	TaskStatusFailed
)

type TaskStatusReportRequest

type TaskStatusReportRequest struct {
	NodeID        uint       `json:"node_id"`
	TaskSpecifier string     `json:"specifier"`
	TaskType      SyncType   `json:"task_type"`
	Status        TaskStatus `json:"status"`
}

type TaskStatusReportResponse

type TaskStatusReportResponse struct {
	Result ResponseType `json:"result"`
	Msg    string       `json:msg"`
}

type TaskStatusRequest

type TaskStatusRequest struct {
	TaskSpecifier string   `json:"task_specifier"`
	Type          SyncType `json:"type"`
	NodeID        uint     `json:"node_id"`
}

TaskStatusRequest send by syncd to request the status of a task

type TaskStatusResponse

type TaskStatusResponse struct {
	Status TaskStatus `json:"status"`
	//running or finished by which node
	NodeID uint   `json:"node_id"`
	Msg    string `json:"msg"`
}

TaskStatusResponse represents the task status response

type UnLockRequest

type UnLockRequest struct {
	NodeID uint `json:"node_id"`
}

type UnLockResponse

type UnLockResponse struct {
	Result ResponseType `json:"result"`
	Msg    string       `json:"msg"`
}

Jump to

Keyboard shortcuts

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