mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-15 02:52:41 +00:00
37 lines
417 B
Go
37 lines
417 B
Go
package scimschema
|
|
|
|
type Type int
|
|
|
|
const (
|
|
Unsupported Type = iota
|
|
Schemas
|
|
API
|
|
Param
|
|
)
|
|
|
|
func (t Type) String() string {
|
|
switch t {
|
|
case Schemas:
|
|
return "schemas"
|
|
case API:
|
|
return "api"
|
|
case Param:
|
|
return "param"
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
func TypeFromString(input string) Type {
|
|
switch input {
|
|
case "schemas":
|
|
return Schemas
|
|
case "api":
|
|
return API
|
|
case "param":
|
|
return Param
|
|
}
|
|
|
|
return Unsupported
|
|
}
|