types

package
v0.2.4-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UploadProgressMetaCreated              readableUploadProgressType = 0
	UploadProgressDataUploading            readableUploadProgressType = 1
	UploadProgressDataReplicating          readableUploadProgressType = 2
	UploadProgressSealing                  readableUploadProgressType = 3
	UploadProgressSealed                   readableUploadProgressType = 4
	UploadProgressUploadToPrimaryFailed    readableUploadProgressType = 5
	UploadProgressAllocSecondaryFailed     readableUploadProgressType = 6
	UploadProgressReplicateSecondaryFailed readableUploadProgressType = 7
	UploadProgressSignObjectFailed         readableUploadProgressType = 8
	UploadProgressSealObjectFailed         readableUploadProgressType = 9
	UploadProgressObjectDiscontinued       readableUploadProgressType = 10
)

Variables

View Source
var StateToProgressType = map[TaskState]readableUploadProgressType{
	TaskState_TASK_STATE_INIT_UNSPECIFIED:       UploadProgressMetaCreated,
	TaskState_TASK_STATE_UPLOAD_OBJECT_DOING:    UploadProgressDataUploading,
	TaskState_TASK_STATE_UPLOAD_OBJECT_DONE:     UploadProgressDataReplicating,
	TaskState_TASK_STATE_UPLOAD_OBJECT_ERROR:    UploadProgressUploadToPrimaryFailed,
	TaskState_TASK_STATE_ALLOC_SECONDARY_DOING:  UploadProgressDataReplicating,
	TaskState_TASK_STATE_ALLOC_SECONDARY_DONE:   UploadProgressDataReplicating,
	TaskState_TASK_STATE_ALLOC_SECONDARY_ERROR:  UploadProgressAllocSecondaryFailed,
	TaskState_TASK_STATE_REPLICATE_OBJECT_DOING: UploadProgressDataReplicating,
	TaskState_TASK_STATE_REPLICATE_OBJECT_DONE:  UploadProgressDataReplicating,
	TaskState_TASK_STATE_REPLICATE_OBJECT_ERROR: UploadProgressReplicateSecondaryFailed,
	TaskState_TASK_STATE_SIGN_OBJECT_DOING:      UploadProgressSealing,
	TaskState_TASK_STATE_SIGN_OBJECT_DONE:       UploadProgressSealing,
	TaskState_TASK_STATE_SIGN_OBJECT_ERROR:      UploadProgressSignObjectFailed,
	TaskState_TASK_STATE_SEAL_OBJECT_DOING:      UploadProgressSealing,
	TaskState_TASK_STATE_SEAL_OBJECT_DONE:       UploadProgressSealed,
	TaskState_TASK_STATE_SEAL_OBJECT_ERROR:      UploadProgressSealObjectFailed,
	TaskState_TASK_STATE_OBJECT_DISCONTINUED:    UploadProgressObjectDiscontinued,
}

StateToProgressType convents inner state to the readable type

View Source
var TaskState_name = map[int32]string{
	0:  "TASK_STATE_INIT_UNSPECIFIED",
	1:  "TASK_STATE_UPLOAD_OBJECT_DOING",
	2:  "TASK_STATE_UPLOAD_OBJECT_DONE",
	3:  "TASK_STATE_UPLOAD_OBJECT_ERROR",
	4:  "TASK_STATE_ALLOC_SECONDARY_DOING",
	5:  "TASK_STATE_ALLOC_SECONDARY_DONE",
	6:  "TASK_STATE_ALLOC_SECONDARY_ERROR",
	7:  "TASK_STATE_REPLICATE_OBJECT_DOING",
	8:  "TASK_STATE_REPLICATE_OBJECT_DONE",
	9:  "TASK_STATE_REPLICATE_OBJECT_ERROR",
	10: "TASK_STATE_SIGN_OBJECT_DOING",
	11: "TASK_STATE_SIGN_OBJECT_DONE",
	12: "TASK_STATE_SIGN_OBJECT_ERROR",
	13: "TASK_STATE_SEAL_OBJECT_DOING",
	14: "TASK_STATE_SEAL_OBJECT_DONE",
	15: "TASK_STATE_SEAL_OBJECT_ERROR",
	16: "TASK_STATE_OBJECT_DISCONTINUED",
}
View Source
var TaskState_value = map[string]int32{
	"TASK_STATE_INIT_UNSPECIFIED":       0,
	"TASK_STATE_UPLOAD_OBJECT_DOING":    1,
	"TASK_STATE_UPLOAD_OBJECT_DONE":     2,
	"TASK_STATE_UPLOAD_OBJECT_ERROR":    3,
	"TASK_STATE_ALLOC_SECONDARY_DOING":  4,
	"TASK_STATE_ALLOC_SECONDARY_DONE":   5,
	"TASK_STATE_ALLOC_SECONDARY_ERROR":  6,
	"TASK_STATE_REPLICATE_OBJECT_DOING": 7,
	"TASK_STATE_REPLICATE_OBJECT_DONE":  8,
	"TASK_STATE_REPLICATE_OBJECT_ERROR": 9,
	"TASK_STATE_SIGN_OBJECT_DOING":      10,
	"TASK_STATE_SIGN_OBJECT_DONE":       11,
	"TASK_STATE_SIGN_OBJECT_ERROR":      12,
	"TASK_STATE_SEAL_OBJECT_DOING":      13,
	"TASK_STATE_SEAL_OBJECT_DONE":       14,
	"TASK_STATE_SEAL_OBJECT_ERROR":      15,
	"TASK_STATE_OBJECT_DISCONTINUED":    16,
}
View Source
var ToReadableDescription = map[readableUploadProgressType]string{
	UploadProgressMetaCreated:              "object meta is created onto the chain",
	UploadProgressDataUploading:            "object payload is uploading to the primary SP",
	UploadProgressDataReplicating:          "object payload is replicating to the secondary SPs in the background",
	UploadProgressSealing:                  "object meta is sealing onto the chain in the background",
	UploadProgressSealed:                   "object is succeed to upload and seal onto the chain",
	UploadProgressUploadToPrimaryFailed:    "something is wrong in uploading to primary",
	UploadProgressAllocSecondaryFailed:     "something is wrong in allocating secondary SPs",
	UploadProgressReplicateSecondaryFailed: "something is wrong in uploading to primary",
	UploadProgressSignObjectFailed:         "something is wrong in signing the object",
	UploadProgressSealObjectFailed:         "something is wrong in sealing object",
	UploadProgressObjectDiscontinued:       "object has been discontinued",
}

ToReadableDescription convects readable type to the description string

Functions

func StateToDescription

func StateToDescription(state TaskState) string

StateToDescription convents state to description.

Types

type TaskState added in v0.2.4

type TaskState int32
const (
	TaskState_TASK_STATE_INIT_UNSPECIFIED       TaskState = 0
	TaskState_TASK_STATE_UPLOAD_OBJECT_DOING    TaskState = 1
	TaskState_TASK_STATE_UPLOAD_OBJECT_DONE     TaskState = 2
	TaskState_TASK_STATE_UPLOAD_OBJECT_ERROR    TaskState = 3
	TaskState_TASK_STATE_ALLOC_SECONDARY_DOING  TaskState = 4
	TaskState_TASK_STATE_ALLOC_SECONDARY_DONE   TaskState = 5
	TaskState_TASK_STATE_ALLOC_SECONDARY_ERROR  TaskState = 6
	TaskState_TASK_STATE_REPLICATE_OBJECT_DOING TaskState = 7
	TaskState_TASK_STATE_REPLICATE_OBJECT_DONE  TaskState = 8
	TaskState_TASK_STATE_REPLICATE_OBJECT_ERROR TaskState = 9
	TaskState_TASK_STATE_SIGN_OBJECT_DOING      TaskState = 10
	TaskState_TASK_STATE_SIGN_OBJECT_DONE       TaskState = 11
	TaskState_TASK_STATE_SIGN_OBJECT_ERROR      TaskState = 12
	TaskState_TASK_STATE_SEAL_OBJECT_DOING      TaskState = 13
	TaskState_TASK_STATE_SEAL_OBJECT_DONE       TaskState = 14
	TaskState_TASK_STATE_SEAL_OBJECT_ERROR      TaskState = 15
	TaskState_TASK_STATE_OBJECT_DISCONTINUED    TaskState = 16
)

func (TaskState) EnumDescriptor added in v0.2.4

func (TaskState) EnumDescriptor() ([]byte, []int)

func (TaskState) String added in v0.2.4

func (x TaskState) String() string

Jump to

Keyboard shortcuts

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