types

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 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 BucketMigrationState_name = map[int32]string{
	0:  "BUCKET_MIGRATION_STATE_INIT_UNSPECIFIED",
	1:  "BUCKET_MIGRATION_STATE_SRC_SP_PRE_DEDUCT_QUOTA_DONE",
	2:  "BUCKET_MIGRATION_STATE_DEST_SP_PRE_DEDUCT_QUOTA_DONE",
	5:  "BUCKET_MIGRATION_STATE_MIGRATE_GVG_DOING",
	6:  "BUCKET_MIGRATION_STATE_MIGRATE_GVG_DONE",
	7:  "BUCKET_MIGRATION_STATE_MIGRATE_QUOTA_INFO_DONE",
	10: "BUCKET_MIGRATION_STATE_SEND_COMPLETE_TX_DONE",
	11: "BUCKET_MIGRATION_STATE_WAIT_COMPLETE_TX_EVENT_DONE",
	12: "BUCKET_MIGRATION_STATE_SEND_REJECT_TX_DONE",
	13: "BUCKET_MIGRATION_STATE_WAIT_REJECT_TX_EVENT_DONE",
	14: "BUCKET_MIGRATION_STATE_WAIT_CANCEL_TX_EVENT_DONE",
	20: "BUCKET_MIGRATION_STATE_SRC_SP_GC_DOING",
	21: "BUCKET_MIGRATION_STATE_DEST_SP_GC_DOING",
	30: "BUCKET_MIGRATION_STATE_POST_SRC_SP_DONE",
	31: "BUCKET_MIGRATION_STATE_MIGRATION_FINISHED",
}
View Source
var BucketMigrationState_value = map[string]int32{
	"BUCKET_MIGRATION_STATE_INIT_UNSPECIFIED":              0,
	"BUCKET_MIGRATION_STATE_SRC_SP_PRE_DEDUCT_QUOTA_DONE":  1,
	"BUCKET_MIGRATION_STATE_DEST_SP_PRE_DEDUCT_QUOTA_DONE": 2,
	"BUCKET_MIGRATION_STATE_MIGRATE_GVG_DOING":             5,
	"BUCKET_MIGRATION_STATE_MIGRATE_GVG_DONE":              6,
	"BUCKET_MIGRATION_STATE_MIGRATE_QUOTA_INFO_DONE":       7,
	"BUCKET_MIGRATION_STATE_SEND_COMPLETE_TX_DONE":         10,
	"BUCKET_MIGRATION_STATE_WAIT_COMPLETE_TX_EVENT_DONE":   11,
	"BUCKET_MIGRATION_STATE_SEND_REJECT_TX_DONE":           12,
	"BUCKET_MIGRATION_STATE_WAIT_REJECT_TX_EVENT_DONE":     13,
	"BUCKET_MIGRATION_STATE_WAIT_CANCEL_TX_EVENT_DONE":     14,
	"BUCKET_MIGRATION_STATE_SRC_SP_GC_DOING":               20,
	"BUCKET_MIGRATION_STATE_DEST_SP_GC_DOING":              21,
	"BUCKET_MIGRATION_STATE_POST_SRC_SP_DONE":              30,
	"BUCKET_MIGRATION_STATE_MIGRATION_FINISHED":            31,
}
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 replicating secondary SPs",
	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 CheckAllowUploadStatus added in v1.2.6

func CheckAllowUploadStatus(state TaskState) bool

CheckAllowUploadStatus helps check if the user upload request is allowed based on current state. If a given TaskState is TaskState_TASK_STATE_UPLOAD_OBJECT_DONE or TaskState_TASK_STATE_REPLICATE_OBJECT_DOING, we DO NOT accept any further uploading request for the same object id.

func StateToDescription

func StateToDescription(state TaskState) string

StateToDescription convents state to description.

Types

type BucketMigrationState added in v1.3.0

type BucketMigrationState int32
const (
	BucketMigrationState_BUCKET_MIGRATION_STATE_INIT_UNSPECIFIED BucketMigrationState = 0
	// produced execute plan and pre deduct quota
	BucketMigrationState_BUCKET_MIGRATION_STATE_SRC_SP_PRE_DEDUCT_QUOTA_DONE  BucketMigrationState = 1
	BucketMigrationState_BUCKET_MIGRATION_STATE_DEST_SP_PRE_DEDUCT_QUOTA_DONE BucketMigrationState = 2
	// migrating gvg task
	BucketMigrationState_BUCKET_MIGRATION_STATE_MIGRATE_GVG_DOING       BucketMigrationState = 5
	BucketMigrationState_BUCKET_MIGRATION_STATE_MIGRATE_GVG_DONE        BucketMigrationState = 6
	BucketMigrationState_BUCKET_MIGRATION_STATE_MIGRATE_QUOTA_INFO_DONE BucketMigrationState = 7
	// confirm tx
	BucketMigrationState_BUCKET_MIGRATION_STATE_SEND_COMPLETE_TX_DONE       BucketMigrationState = 10
	BucketMigrationState_BUCKET_MIGRATION_STATE_WAIT_COMPLETE_TX_EVENT_DONE BucketMigrationState = 11
	BucketMigrationState_BUCKET_MIGRATION_STATE_SEND_REJECT_TX_DONE         BucketMigrationState = 12
	BucketMigrationState_BUCKET_MIGRATION_STATE_WAIT_REJECT_TX_EVENT_DONE   BucketMigrationState = 13
	BucketMigrationState_BUCKET_MIGRATION_STATE_WAIT_CANCEL_TX_EVENT_DONE   BucketMigrationState = 14
	// gc
	BucketMigrationState_BUCKET_MIGRATION_STATE_SRC_SP_GC_DOING    BucketMigrationState = 20
	BucketMigrationState_BUCKET_MIGRATION_STATE_DEST_SP_GC_DOING   BucketMigrationState = 21
	BucketMigrationState_BUCKET_MIGRATION_STATE_POST_SRC_SP_DONE   BucketMigrationState = 30
	BucketMigrationState_BUCKET_MIGRATION_STATE_MIGRATION_FINISHED BucketMigrationState = 31
)

func (BucketMigrationState) EnumDescriptor added in v1.3.0

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

func (BucketMigrationState) String added in v1.3.0

func (x BucketMigrationState) String() string

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