10 lines
403 B
Go
10 lines
403 B
Go
package main
|
|
|
|
// A Datatype interface knows how to convert a byte slice into a
|
|
// specific data type.
|
|
type Datatype interface {
|
|
Name() string // Type Name, for UI display
|
|
ToString([]byte) (string, error) // ToString takes a []byte from the DB and returns the string to display
|
|
FromString(string) ([]byte, error) // FromString takes a string and returns the []byte for the DB
|
|
}
|