// RegisterValidationCtx does the same as RegisterValidation on accepts a FuncCtx validation
// allowing context.Context validation support.
166960
func (v *Validate) RegisterValidationCtx(tag string, fn FuncCtx) error {
	return v.registerValidation(tag, fn, false)
}
1236508
func RegisterValidator(name string, v Validator) {
	if _, ok := validators[name]; ok {
		log.Fatalf("Registering duplicate Validator with name %v", name)
	}
	validators[name] = v
}
62844
func (s *Store) EnsureRegistration(idx uint64, req *structs.RegisterRequest) error {
	tx := s.db.Txn(true)
	defer tx.Abort()

	if err := s.ensureRegistrationTxn(tx, idx, req); err != nil {
		return err
	}

	tx.Commit()
	return nil
}
309258
func (dec *Decoder) RegisterCustomType(fn DecodeCustomTypeFunc, types []interface{}, fields []interface{}) *Decoder {
	if dec.customTypes == nil {
		dec.customTypes = make(map[reflect.Type]*DecodeCustomType)
	}
	for i := range types {
		typ := reflect.TypeOf(types[i])
		if dec.customTypes[typ] == nil {
			dec.customTypes[typ] = new(DecodeCustomType)
		}
		if len(fields) > 0 {
			for j := range fields {
				va := reflect.ValueOf(fields[j])
				f := DecodeCustomTypeField{field: va, fun: fn}
				dec.customTypes[typ].fields = append(dec.customTypes[typ].fields, f)
			}
		} else {
			dec.customTypes[typ].fun = fn
		}
	}
	return dec
}
157508
func (t *connTable) Register(ck ckey, matchedRule *Rule, srcIP, srcPort string, targetPort layers.TCPPort) {
	t.mtx.Lock()
	defer t.mtx.Unlock()

	if _, ok := t.table[ck]; ok {
		// TODO: wut?
	} else {
		logger.Debugf("[contable] registering %s:%s->%d", srcIP, srcPort, targetPort)

		t.table[ck] = &Metadata{
			Added:      time.Now(),
			Rule:       matchedRule,
			TargetPort: targetPort,
			//TargetIP:   targetIP,
		}
	}
}
1182902
func ErrorCtx(ctx context.Context, err error, data Data) {
	correlationKey := common.GetRequestId(ctx)
	ErrorC(correlationKey, err, data)
}
563183
func (c *CAClientImpl) Register(request *api.RegistrationRequest) (string, error) {
	if c.adapter == nil {
		return "", fmt.Errorf("no CAs configured for organization: %s", c.orgName)
	}
	if c.registrar.EnrollID == "" {
		return "", api.ErrCARegistrarNotFound
	}
	// Validate registration request
	if request == nil {
		return "", errors.New("registration request is required")
	}
	if request.Name == "" {
		return "", errors.New("request.Name is required")
	}

	registrar, err := c.getRegistrar(c.registrar.EnrollID, c.registrar.EnrollSecret)
	if err != nil {
		return "", err
	}

	secret, err := c.adapter.Register(registrar.PrivateKey(), registrar.EnrollmentCertificate(), request)
	if err != nil {
		return "", errors.Wrap(err, "failed to register user")
	}

	return secret, nil
}
1008755
func (m *MockEventService) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error) {
	eventCh := make(chan *fab.CCEvent)
	reg := &dispatcher.ChaincodeReg{
		Eventch:     eventCh,
		ChaincodeID: ccID,
		EventFilter: eventFilter,
	}
	return reg, eventCh, nil
}
1312888
func (m *Manager) RegisterCompilerTrigger(f func(txn storage.Transaction)) {
	m.mtx.Lock()
	defer m.mtx.Unlock()
	m.registeredTriggers = append(m.registeredTriggers, f)
}
1070961
func (c *Converter) RegisterUntypedConversionFunc(a, b interface{}, fn ConversionFunc) error {
	return c.conversionFuncs.AddUntyped(a, b, fn)
}
1241744
func (registry *Registry) RegisterFunc(name string, check func() error) {
	registry.Register(name, CheckFunc(check))
}
863726
func (ref *EventClientRef) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error) {
	service, err := ref.get()
	if err != nil {
		return nil, nil, err
	}
	return service.RegisterBlockEvent(filter...)
}
765755
func (c *Collection) RegisterTx(fns ...func(DB) error) error {
	return c.register(true, fns...)
}
917624
func ValidateAuthTokenWithCtx(
	ctx types.Context,
	config *types.AuthConfig) (*types.AuthToken, error) {

	if tok, ok := context.AuthToken(ctx); ok {
		logFields := map[string]interface{}{"sub": tok.Subject}
		err := validateAuthTokenAllowed(ctx, config, logFields, tok)
		if err != nil {
			return nil, err
		}
		ctx.WithFields(logFields).Info("validated security token")
		return tok, nil
	}

	return nil, nil
}
785271
func RegisterExtensionCheck(name string, oid asn1.ObjectIdentifier, filter *Filter, f func(pkix.Extension, *certdata.Data) *errors.Errors) {
	extMutex.Lock()
	Extensions = append(Extensions, extensionCheck{name, oid, filter, f})
	extMutex.Unlock()
}
1298619
func RegisterTemplateLoader(key string, loader func(loader *TemplateLoader) (TemplateEngine, error)) (err error) {
	if _, found := templateLoaderMap[key]; found {
		err = fmt.Errorf("Template loader %s already exists", key)
	}
	templateLog.Debug("Registered template engine loaded", "name", key)
	templateLoaderMap[key] = loader
	return
}
762172
func (r *ImportServiceAccountsConfigsRPC) SetupConfigValidation(rules *validation.RuleSet) {
	r.RulesCache.SetupConfigValidation(rules)
}