github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/helper/schema/field_type.go (about)

     1  package schema
     2  
     3  // FieldType is the enum of types that a field can be.
     4  type FieldType uint
     5  
     6  const (
     7  	TypeInvalid FieldType = 0
     8  	TypeString  FieldType = iota
     9  	TypeInt
    10  	TypeBool
    11  	TypeMap
    12  )
    13  
    14  func (t FieldType) String() string {
    15  	switch t {
    16  	case TypeString:
    17  		return "string"
    18  	case TypeInt:
    19  		return "int"
    20  	case TypeBool:
    21  		return "bool"
    22  	case TypeMap:
    23  		return "map"
    24  	default:
    25  		return "unknown type"
    26  	}
    27  }