MCPcopy
hub / github.com/cloudreve/cloudreve / TypeValidator

Function TypeValidator

ent/node/node.go:138–145  ·  view source on GitHub ↗

TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.

(_type Type)

Source from the content-addressed store, hash-verified

136
137// TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.
138func 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.
148type OrderOption func(*sql.Selector)

Callers 3

checkMethod · 0.92
checkMethod · 0.92
checkMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected