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

Method check

ent/node_update.go:645–657  ·  view source on GitHub ↗

check runs all checks and user-defined validators on the builder.

()

Source from the content-addressed store, hash-verified

643
644// check runs all checks and user-defined validators on the builder.
645func (nuo *NodeUpdateOne) check() error {
646 if v, ok := nuo.mutation.Status(); ok {
647 if err := node.StatusValidator(v); err != nil {
648 return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Node.status": %w`, err)}
649 }
650 }
651 if v, ok := nuo.mutation.GetType(); ok {
652 if err := node.TypeValidator(v); err != nil {
653 return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Node.type": %w`, err)}
654 }
655 }
656 return nil
657}
658
659func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) {
660 if err := nuo.check(); err != nil {

Callers 1

sqlSaveMethod · 0.95

Calls 4

StatusValidatorFunction · 0.92
TypeValidatorFunction · 0.92
StatusMethod · 0.65
GetTypeMethod · 0.45

Tested by

no test coverage detected