31 lines
653 B
Go
31 lines
653 B
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type ResourceType string
|
|
|
|
var (
|
|
ResourceTypeUnd ResourceType = "" // "und"
|
|
ResourceTypeAudio ResourceType = "audio" // "audio"
|
|
ResourceTypeImage ResourceType = "image" // "image"
|
|
ResourceTypePage ResourceType = "page" // "page"
|
|
ResourceTypeText ResourceType = "text" // "text"
|
|
ResourceTypeVideo ResourceType = "video" // "video"
|
|
)
|
|
|
|
var ErrResourceType error = errors.New("unsupported ResourceType enum")
|
|
|
|
func (rt ResourceType) String() string {
|
|
if rt != "" {
|
|
return string(rt)
|
|
}
|
|
|
|
return "und"
|
|
}
|
|
|
|
func (rt ResourceType) GoString() string {
|
|
return "domain.ResourceType(" + rt.String() + ")"
|
|
}
|