Try int
This commit is contained in:
parent
5ee2cf0d24
commit
b4d92869f8
@ -23,15 +23,30 @@ import (
|
|||||||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||||
|
|
||||||
type BackupState string
|
type BackupState int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
New BackupState = "New"
|
Success BackupState = 3
|
||||||
Running BackupState = "Running"
|
New BackupState = 2
|
||||||
Success BackupState = "Success"
|
Running BackupState = 1
|
||||||
Failure BackupState = "Failure"
|
Failure BackupState = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (b *BackupState) String() string {
|
||||||
|
var state string
|
||||||
|
switch *b {
|
||||||
|
case Failure:
|
||||||
|
state = "Failure"
|
||||||
|
case Running:
|
||||||
|
state = "Running"
|
||||||
|
case New:
|
||||||
|
state = "New"
|
||||||
|
case Success:
|
||||||
|
state = "Success"
|
||||||
|
}
|
||||||
|
return state
|
||||||
|
}
|
||||||
|
|
||||||
type Ref struct {
|
type Ref struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user