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

Method check

pkg/database/ent/machine_update.go:855–862  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

853
854// check runs all checks and user-defined validators on the builder.
855func (_u *MachineUpdateOne) check() error {
856 if v, ok := _u.mutation.Scenarios(); ok {
857 if err := machine.ScenariosValidator(v); err != nil {
858 return &ValidationError{Name: "scenarios", err: fmt.Errorf(`ent: validator failed for field "Machine.scenarios": %w`, err)}
859 }
860 }
861 return nil
862}
863
864func (_u *MachineUpdateOne) sqlSave(ctx context.Context) (_node *Machine, err error) {
865 if err := _u.check(); err != nil {

Callers 1

sqlSaveMethod · 0.95

Calls 1

ScenariosMethod · 0.80

Tested by

no test coverage detected