matterbridge/vendor/github.com/pelletier/go-toml/v2/unstable/kind.go

72 lines
1.0 KiB
Go
Raw Normal View History

2023-01-28 22:57:53 +01:00
package unstable
2022-04-25 23:50:10 +02:00
import "fmt"
2023-01-28 22:57:53 +01:00
// Kind represents the type of TOML structure contained in a given Node.
2022-04-25 23:50:10 +02:00
type Kind int
const (
2023-01-28 22:57:53 +01:00
// Meta
2022-04-25 23:50:10 +02:00
Invalid Kind = iota
Comment
Key
2023-01-28 22:57:53 +01:00
// Top level structures
2022-04-25 23:50:10 +02:00
Table
ArrayTable
KeyValue
2023-01-28 22:57:53 +01:00
// Containers values
2022-04-25 23:50:10 +02:00
Array
InlineTable
2023-01-28 22:57:53 +01:00
// Values
2022-04-25 23:50:10 +02:00
String
Bool
Float
Integer
LocalDate
LocalTime
LocalDateTime
DateTime
)
2023-01-28 22:57:53 +01:00
// String implementation of fmt.Stringer.
2022-04-25 23:50:10 +02:00
func (k Kind) String() string {
switch k {
case Invalid:
return "Invalid"
case Comment:
return "Comment"
case Key:
return "Key"
case Table:
return "Table"
case ArrayTable:
return "ArrayTable"
case KeyValue:
return "KeyValue"
case Array:
return "Array"
case InlineTable:
return "InlineTable"
case String:
return "String"
case Bool:
return "Bool"
case Float:
return "Float"
case Integer:
return "Integer"
case LocalDate:
return "LocalDate"
case LocalTime:
return "LocalTime"
case LocalDateTime:
return "LocalDateTime"
case DateTime:
return "DateTime"
}
panic(fmt.Errorf("Kind.String() not implemented for '%d'", k))
}