// Register registers a new handler for the given method name
481107
func (s *StreamingRpcRegistry) Register(method string, handler StreamingRpcHandler) {
	s.registry[method] = handler
}
1298536
func (p *Namespaces) Register(ns Namespace) {
	if !p.Safe {
		p.mu.Lock()
		defer p.mu.Unlock()
	}
	if p.prefixes == nil {
		p.prefixes = make(map[string]string)
	}
	p.prefixes[ns.Prefix] = ns.Full
}
705719
func register(e *Endpoint) {
	endpoints.mu.Lock()
	defer endpoints.mu.Unlock()

	endpoints.registered = append(endpoints.registered, e)
}
518932
func (r *Registrar) Register() {
	if err := r.client.Register(r.service); err != nil {
		r.logger.Log("err", err)
	} else {
		r.logger.Log("action", "register")
	}
	if r.service.TTL != nil {
		go r.loop()
	}
}
804968
func (reg *WatchDataReg) Register(resyncName, keyPrefix string) error {
	reg.adapter.access.Lock()
	defer reg.adapter.access.Unlock()

	for resName, sub := range reg.adapter.subscriptions {
		if resName == resyncName {
			// Verify that prefix does not exist yet
			for _, regPrefix := range sub.KeyPrefixes {
				if regPrefix == keyPrefix {
					return fmt.Errorf("prefix %q already exists", keyPrefix)
				}
			}
			sub.KeyPrefixes = append(sub.KeyPrefixes, keyPrefix)
			return nil
		}
	}
	return fmt.Errorf("cannot register prefix %s, resync name %s not found", keyPrefix, resyncName)
}
532160
func (mgr *MockCAClient) Register(request *api.RegistrationRequest) (string, error) {
	return "", errors.New("not implemented")
}
95175
func Register(name string, m Meddler) {
	if name == "pk" {
		panic("meddler.Register: pk cannot be used as a meddler name")
	}
	registry[name] = m
}
425846
func Register(name string, factory acl.Factory) {
	mu.Lock()
	defer mu.Unlock()
	if _, ok := acls[name]; ok {
		panic(fmt.Sprintf("register a registered key: %s", name))
	}
	acls[name] = factory
}
914278
func (p *Registrar) Register() {
	if err := p.client.Register(p.registration); err != nil {
		p.logger.Log("err", err)
	} else {
		p.logger.Log("action", "register")
	}
}
449043
func Register(name string, formatter chroma.Formatter) chroma.Formatter {
	Registry[name] = formatter
	return formatter
}
1032723
func (s *Server) Register(api API) {
	uri := api.URI()
	if len(uri) == 0 {
		panic("URI() return empty string")
	}
	if uri[0] != '/' {
		uri = "/" + uri
	}
	log.Infof("New api handler, uri=%s", uri)

	// raw http handler
	if handler, ok := api.(http.Handler); ok {
		s.Get("/v2"+uri, handler.ServeHTTP)
		return
	}
	s.Get(
		"/v2"+uri,
		func(w http.ResponseWriter, r *http.Request, es *EventSource, ctx context.Context) {
			if GetBool(r, "watch", false) {
				handleWatch(api, w, r, es, ctx)
			} else {
				handleGet(api, w, r, ctx)
			}
		},
	)
}
972253
func Register(name string, fn NewConnFunc) {
	mu.Lock()
	defer mu.Unlock()
	if _, ok := services[name]; ok {
		panic(fmt.Sprintf("register a registered key: %s", name))
	}
	services[name] = fn
}
894765
func Register(name string, adapter Config) {
	if adapter == nil {
		panic("config: Register adapter is nil")
	}
	if _, ok := adapters[name]; ok {
		panic("config: Register called twice for adapter " + name)
	}
	adapters[name] = adapter
}
782683
func (r *Registry) Register(name string, f ClientFactory) {
	r.lock.Lock()
	defer r.lock.Unlock()

	if _, ok := r.protocols[name]; ok {
		panic(fmt.Errorf("streamclient: protocol already registered for [%s]", name))
	}
	if r.protocols == nil {
		r.protocols = make(map[string]ClientFactory)
	}
	r.protocols[name] = f
}
1021033
func (r *StandardRegistry) Register(name string, i interface{}) error {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	return r.register(name, i)
}
1318838
func Register(name string, initFunc InitFunc) error {
	if middlewares == nil {
		middlewares = make(map[string]InitFunc)
	}
	if _, exists := middlewares[name]; exists {
		return fmt.Errorf("name already registered: %s", name)
	}

	middlewares[name] = initFunc

	return nil
}
384929
func (c *ServiceConfig) RegisterEventHandler(handler ServiceHandler) {
	c.eventHandlers = append(c.eventHandlers, handler)
}