mirror of
https://github.com/rancher/types.git
synced 2025-08-31 12:48:45 +00:00
Move mappers
This commit is contained in:
37
mapper/status.go
Normal file
37
mapper/status.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/types/status"
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
}
|
||||
|
||||
func (s Status) FromInternal(data map[string]interface{}) {
|
||||
status.Set(data)
|
||||
}
|
||||
|
||||
func (s Status) ToInternal(data map[string]interface{}) {
|
||||
}
|
||||
|
||||
func (s Status) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
schema.ResourceFields["state"] = types.Field{
|
||||
CodeName: "State",
|
||||
Type: "string",
|
||||
}
|
||||
schema.ResourceFields["transitioning"] = types.Field{
|
||||
CodeName: "Transitioning",
|
||||
Type: "enum",
|
||||
Options: []string{
|
||||
"yes",
|
||||
"no",
|
||||
"error",
|
||||
},
|
||||
}
|
||||
schema.ResourceFields["transitioningMessage"] = types.Field{
|
||||
CodeName: "TransitioningMessage",
|
||||
Type: "string",
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user