TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.
(_type Type)
| 136 | |
| 137 | // TypeValidator is a validator for the "type" field enum values. It is called by the builders before save. |
| 138 | func TypeValidator(_type Type) error { |
| 139 | switch _type { |
| 140 | case TypeMaster, TypeSlave: |
| 141 | return nil |
| 142 | default: |
| 143 | return fmt.Errorf("node: invalid enum value for type field: %q", _type) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // OrderOption defines the ordering options for the Node queries. |
| 148 | type OrderOption func(*sql.Selector) |