MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / StatusValidator

Function StatusValidator

ent/node/node.go:115–122  ·  view source on GitHub ↗

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

(s Status)

Source from the content-addressed store, hash-verified

113
114// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
115func StatusValidator(s Status) error {
116 switch s {
117 case StatusActive, StatusSuspended:
118 return nil
119 default:
120 return fmt.Errorf("node: invalid enum value for status field: %q", s)
121 }
122}
123
124// Type defines the type for the "type" enum field.
125type Type string

Callers 3

checkMethod · 0.92
checkMethod · 0.92
checkMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected