func UnmarshalResourceTypeString(in string) ResourceType {
	switch in {
	case "nano":
		return ResourceTypeNano
	case "micro":
		return ResourceTypeMicro
	case "small":
		return ResourceTypeSmall
	case "medium":
		return ResourceTypeMedium
	case "large":
		return ResourceTypeLarge
	case "xlarge":
		return ResourceTypeXLarge
	case "2xlarge":
		return ResourceType2XLarge
	case "3xlarge":
		return ResourceType3XLarge
	case "4xlarge":
		return ResourceType4XLarge
	}
	return ResourceTypeUnknown
}
UnmarshalResourceTypeString cast type from string to ResourceType
package datastore
import (
	"database/sql/driver"
	"encoding/json"
	"fmt"
	pb "github.com/whywaita/myshoes/api/proto"
)
type ResourceType int
const (
	ResourceTypeUnknown ResourceType = iota
	ResourceTypeNano
	ResourceTypeMicro
	ResourceTypeSmall
	ResourceTypeMedium
	ResourceTypeLarge
	ResourceTypeXLarge
	ResourceType2XLarge
	ResourceType3XLarge
	ResourceType4XLarge
)
func (r ResourceType) String() string {
	switch r {
	case ResourceTypeNano:
		return "nano"
	case ResourceTypeMicro:
		return "micro"
	case ResourceTypeSmall:
		return "small"
	case ResourceTypeMedium:
		return "medium"
	case ResourceTypeLarge:
		return "large"
	case ResourceTypeXLarge:
		return "xlarge"
	case ResourceType2XLarge:
		return "2xlarge"
	case ResourceType3XLarge:
		return "3xlarge"
	case ResourceType4XLarge:
		return "4xlarge"
	}
	return "unknown"
}
func (r ResourceType) Value() (driver.Value, error) {
	return driver.Value(r.String()), nil
}
func (r *ResourceType) Scan(src interface{}) error {
	var rt *ResourceType
	switch src := src.(type) {
	case string:
		unmarshaled := UnmarshalResourceType(src)
		rt = &unmarshaled
	case []uint8:
		str := string(src)
		unmarshaled := UnmarshalResourceType(str)
		rt = &unmarshaled
	default:
		return fmt.Errorf("incompatible type for ResourceType: %T", src)
	}
	*r = *rt
	return nil
}
func UnmarshalResourceType(src interface{}) ResourceType {
	switch src := src.(type) {
	case string:
		return UnmarshalResourceTypeString(src)
	case pb.ResourceType:
		return UnmarshalResourceTypePb(src)
	}
	return ResourceTypeUnknown
}