// AddCheck provides a mock function with given fields: check
12912
func (_m *Store) AddCheck(check types.CheckSpec) error {
	ret := _m.Called(check)

	var r0 error
	if rf, ok := ret.Get(0).(func(types.CheckSpec) error); ok {
		r0 = rf(check)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
261670
func (e Equalities) AddFunc(eqFunc interface{}) error {
	fv := reflect.ValueOf(eqFunc)
	ft := fv.Type()
	if ft.Kind() != reflect.Func {
		return fmt.Errorf("expected func, got: %v", ft)
	}
	if ft.NumIn() != 2 {
		return fmt.Errorf("expected two 'in' params, got: %v", ft)
	}
	if ft.NumOut() != 1 {
		return fmt.Errorf("expected one 'out' param, got: %v", ft)
	}
	if ft.In(0) != ft.In(1) {
		return fmt.Errorf("expected arg 1 and 2 to have same type, but got %v", ft)
	}
	var forReturnType bool
	boolType := reflect.TypeOf(forReturnType)
	if ft.Out(0) != boolType {
		return fmt.Errorf("expected bool return, got: %v", ft)
	}
	e[ft.In(0)] = fv
	return nil
}
1362769
func Check(err error, checker func(error) bool) bool {
	if annotated, ok := err.(*annotatedError); ok {
		return checker(annotated.LastError())
	}
	return checker(err)
}
903377
func JustCheck(auth AuthenticatorInterface, wrapped http.HandlerFunc) http.HandlerFunc {
	return auth.Wrap(func(w http.ResponseWriter, ar *AuthenticatedRequest) {
		ar.Header.Set(AuthUsernameHeader, ar.Username)
		wrapped(w, &ar.Request)
	})
}
184671
func (s *Store) EnsureCheck(idx uint64, hc *structs.HealthCheck) error {
	tx := s.db.Txn(true)
	defer tx.Abort()

	// Call the check registration
	if err := s.ensureCheckTxn(tx, idx, hc); err != nil {
		return err
	}

	tx.Commit()
	return nil
}
346274
func RegisterHealthcheck(r interface{}, collectors ...func() (statKey string, stats interface{})) error {
	return doReg(r, collectors, false, true)
}
216668
func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain {
	lock.Lock()
	c.formatters[name] = f
	lock.Unlock()

	return c
}
795424
func AddCheckSum(content string) (string, error) {
	if content == "" {
		return "", errors.New("content is empty")
	}

	even := len(content)%2 == 1
	sum := 0
	for _, r := range content {
		if _, ok := encodingTable[r]; ok {
			value := utils.RuneToInt(r)
			if even {
				sum += value * 3
			} else {
				sum += value
			}
			even = !even
		} else {
			return "", fmt.Errorf("can not encode \"%s\"", content)
		}
	}

	return content + string(utils.IntToRune(sum%10)), nil
}
684030
func OptionCheck(args []string) (err error) {
	opt := newOption(ioutil.Discard, flag.ContinueOnError)
	if e := opt.parse(args); e != nil {
		return fmt.Errorf("%v, %v", CommandName, e)
	}
	return nil
}
472635
func (h *Health) AddCheck(cfg *Config) error {
	if h.active.val() {
		return ErrNoAddCfgWhenActive
	}

	h.configs = append(h.configs, cfg)
	return nil
}
1124620
func newChecker(o *storage.LookupOptions, op *predicate.Predicate) *checker {
	var ta *time.Time
	if op != nil {
		if t, err := op.TimeAnchor(); err == nil {
			ta = t
		}
	}
	return &checker{
		max: o.MaxElements > 0,
		c:   o.MaxElements,
		o:   o,
		op:  op,
		ota: ta,
	}
}
763423
func NewChecker(policy *audit.Policy) Checker {
	for i, rule := range policy.Rules {
		policy.Rules[i].OmitStages = unionStages(policy.OmitStages, rule.OmitStages)
	}
	return &policyChecker{*policy}
}
484535
func NewCheckSup(s string) (checkSup, error) {
	var e checkSup
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
1365562
func (check StatusChecker) RunCheck() Status {
	statusChannel := make(chan Status, 1)
	go func() {
		status := check()
		if status.GoodToGo {
			status.Message = "OK"
		}
		statusChannel <- status
	}()
	select {
	case status := <-statusChannel:
		return status
	case <-time.After(time.Second * time.Duration(timeout)):
		return Status{GoodToGo: false, Message: timeoutMessage}
	}
}
119266
func (cons *SimpleConsumer) AddHealthCheckAt(path string, callback thealthcheck.CallbackFunc) {
	thealthcheck.AddEndpoint("/"+cons.GetID()+path, callback)
}
1168114
func (s *Sensu) GetCheck(check string) (map[string]interface{}, error) {
	return s.get(fmt.Sprintf("checks/%s", check))
}
1342995
func (s *GenericAPIServer) AddHealthzChecks(checks ...healthz.HealthzChecker) error {
	s.healthzLock.Lock()
	defer s.healthzLock.Unlock()

	if s.healthzCreated {
		return fmt.Errorf("unable to add because the healthz endpoint has already been created")
	}

	s.healthzChecks = append(s.healthzChecks, checks...)
	return nil
}