// Register a db connection.
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
}
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,
		}
	}
}
382809
func Register(plugins *admission.Plugins) {
	plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
		newImagePolicyWebhook, err := NewImagePolicyWebhook(config)
		if err != nil {
			return nil, err
		}
		return newImagePolicyWebhook, nil
	})
}
667864
func (db *Database) Connect(ctx context.Context) error {
	if err := db.auth.Setup(ctx, db); err != nil {
		return err
	}
	if _, err := db.Send(ctx, &requests.CurrentDatabase{}); err != nil {
		return err
	}
	return nil
}
776612
func Register(handler func()) {
	handlersLock.Lock()
	defer handlersLock.Unlock()
	handlers = append(handlers, handler)
}
828844
func Connect(file string) (*DB, error) {
	db := &DB{
		Driver: "sqlite3",
		DSN:    file,
	}

	connection, err := sqlx.Open(db.Driver, db.DSN)
	if err != nil {
		return nil, err
	}
	db.connection = connection

	if db.cache == nil {
		db.cache = make(map[string]*sql.Stmt)
	}

	return db, nil
}
89906
func NewRegisterConnectionEvent(eventch chan<- *ConnectionEvent, regch chan<- fab.Registration, errch chan<- error) *RegisterConnectionEvent {
	return &RegisterConnectionEvent{
		Reg:           &ConnectionReg{Eventch: eventch},
		RegisterEvent: esdispatcher.NewRegisterEvent(regch, errch),
	}
}
194179
func (a *AuditBroker) Register(name string, b audit.Backend, v *BarrierView, local bool) {
	a.Lock()
	defer a.Unlock()
	a.backends[name] = backendEntry{
		backend: b,
		view:    v,
		local:   local,
	}
}
1348916
func (c *connection) registerStream(s httpstream.Stream) {
	c.streamLock.Lock()
	c.streams = append(c.streams, s)
	c.streamLock.Unlock()
}
47312
func (ens *ENS) Register(name string) (*types.Transaction, error) {
	parentNode, label := ensParentNode(name)
	registrar, err := ens.getRegistrar(parentNode)
	if err != nil {
		return nil, err
	}
	return registrar.Contract.Register(&ens.TransactOpts, label, ens.TransactOpts.From)
}
394527
func (kv *KV) Register(table []byte) error {
	if len(table) == 0 {
		return gkv.ErrTableName
	}
	kv.table = table
	_, err := kv.db.Exec(fmt.Sprintf(`
PRAGMA foreign_keys = FALSE;
CREATE TABLE IF NOT EXISTS %s (
	id VARCHAR(34) NOT NULL,
	k TEXT NOT NULL,
	v TEXT NOT NULL,
	PRIMARY KEY (id)
);
PRAGMA foreign_keys = TRUE;
`, string(table)))
	return err
}
708591
func (c *Client) Register(event NotifyCategory) error {
	if event == ChannelEvents {
		return c.RegisterChannel(0)
	}

	_, err := c.ExecCmd(NewCmd("servernotifyregister").WithArgs(
		NewArg("event", event),
	))
	return err
}
77698
func (cli *Client) Register(req *ReqRegister) (*RespRegister, *RespUserInteractive, error) {
	u := cli.BuildURL("register")
	return cli.register(u, req)
}
903856
func (r *Registrar) Register() {
	r.Lock()
	defer r.Unlock()

	if r.quitc != nil {
		return // Already in the registration loop.
	}

	if err := r.conn.RegisterInstance(r.instance); err != nil {
		r.logger.Log("during", "Register", "err", err)
	}

	r.quitc = make(chan chan struct{})
	go r.loop()
}
705719
func register(e *Endpoint) {
	endpoints.mu.Lock()
	defer endpoints.mu.Unlock()

	endpoints.registered = append(endpoints.registered, e)
}
199519
func (a *Module) Register(p string, v interface{}, methods ...string) *Module {
	if len(methods) < 1 {
		methods = append(methods, "GET")
	}
	a.Application.URLBuilder.Set(v)
	h := a.Core.ValidHandler(v)
	a.Router().Match(methods, p, func(ctx echo.Context) error {
		if c, y := ctx.(Initer); y {
			if err := c.Init(ctx); err != nil {
				return err
			}
		}
		return h.Handle(ctx)
	})
	return a
}
529499
func (connector *Connector) Register(intf interface{}, fn ServiceFactoryFunc) {
	connector.registry.Register(reflect.TypeOf(intf), fn)
}