MCPcopy
hub / github.com/crowdsecurity/crowdsec / check

Method check

pkg/database/ent/machine_update.go:357–364  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

355
356// check runs all checks and user-defined validators on the builder.
357func (_u *MachineUpdate) check() error {
358 if v, ok := _u.mutation.Scenarios(); ok {
359 if err := machine.ScenariosValidator(v); err != nil {
360 return &ValidationError{Name: "scenarios", err: fmt.Errorf(`ent: validator failed for field "Machine.scenarios": %w`, err)}
361 }
362 }
363 return nil
364}
365
366func (_u *MachineUpdate) sqlSave(ctx context.Context) (_node int, err error) {
367 if err := _u.check(); err != nil {

Callers 1

sqlSaveMethod · 0.95

Calls 1

ScenariosMethod · 0.80

Tested by

no test coverage detected