// RegisterStandard is the more convenient way of registering
// facades. newFunc should have one of the following signatures:
//   func (facade.Context) (*Type, error)
//   func (*state.State, facade.Resources, facade.Authorizer) (*Type, error)
183133
func (f *Registry) RegisterStandard(name string, version int, newFunc interface{}) error {
	wrapped, facadeType, err := wrapNewFacade(newFunc)
	if err != nil {
		return errors.Trace(err)
	}
	err = f.Register(name, version, wrapped, facadeType)
	if err != nil {
		return errors.Trace(err)
	}
	return nil
}
67028
func (s *LocalSupervisor) RegisterCriticalFunc(name string, fn ServiceFunc) {
	s.Register(&LocalService{Function: fn, ServiceName: name, Critical: true})
}
96706
func NewGaugeDurationFunc(name string, help string, f func() time.Duration) *GaugeDurationFunc {
	gf := &GaugeDurationFunc{
		CounterDurationFunc: CounterDurationFunc{
			F:    f,
			help: help,
		},
	}

	if name != "" {
		publish(name, gf)
	}
	return gf
}
1107964
func (c *Client) BasicRegister(procedure string, fn BasicMethodHandler) error {
	wrap := func(args []interface{}, kwargs map[string]interface{},
		details map[string]interface{}) (result *CallResult) {
		return fn(args, kwargs)
	}
	return c.Register(procedure, wrap, make(map[string]interface{}))
}
373009
func RegisterDeferredConfig(id loader.PluginID, config *loader.InternalPluginConfig, configLoader ConfigFromOptions) {
	mu.Lock()
	defer mu.Unlock()
	catalog[id] = &Registration{
		Config:       config,
		ConfigLoader: configLoader,
	}
}
1274087
func (daemon *Daemon) Register(c *container.Container) error {
	// Attach to stdout and stderr
	if c.Config.OpenStdin {
		c.StreamConfig.NewInputPipes()
	} else {
		c.StreamConfig.NewNopInputPipe()
	}

	// once in the memory store it is visible to other goroutines
	// grab a Lock until it has been checkpointed to avoid races
	c.Lock()
	defer c.Unlock()

	daemon.containers.Add(c.ID, c)
	daemon.idIndex.Add(c.ID)
	return c.CheckpointTo(daemon.containersReplica)
}
1307891
func (s *RegistrarService) RegisterDomain(accountID string, domainName string, request *DomainRegisterRequest) (*domainRegistrationResponse, error) {
	path := versioned(fmt.Sprintf("/%v/registrar/domains/%v/registrations", accountID, domainName))
	registrationResponse := &domainRegistrationResponse{}

	// TODO: validate mandatory attributes RegistrantID

	resp, err := s.client.post(path, request, registrationResponse)
	if err != nil {
		return nil, err
	}

	registrationResponse.HttpResponse = resp
	return registrationResponse, nil
}
31191
func Register(scheme string, fn func(*url.URL) (*ConnectionHelper, error)) {
	helpers[scheme] = fn
}
17583
func (s *StandardsSubscriptionRequest) SetStandardsInput(v map[string]*string) *StandardsSubscriptionRequest {
	s.StandardsInput = v
	return s
}
487955
func RegisterFunctionalBuiltin3(name string, fun FunctionalBuiltin3) {
	builtinFunctions[name] = functionalWrapper3(name, fun)
}
150667
func (runner *runner) AddReloadFunc(reloadFunc func()) {
	runner.mu.Lock()
	defer runner.mu.Unlock()

	// We only need to listen to firewalld if there are Reload functions, so lazy
	// initialize the listener.
	if !runner.hasListener {
		runner.connectToFirewallD()
	}

	runner.reloadFuncs = append(runner.reloadFuncs, reloadFunc)
}
1304712
func RegisterConfigReg(name string, f types.NewConfigReg) {
	cfgRegsRWL.Lock()
	defer cfgRegsRWL.Unlock()
	cfgRegs = append(cfgRegs, &cregW{name, f})
}
1305254
func NewFuncRegistry() *FuncRegistry {
	return &FuncRegistry{
		funcs: make(map[string]Func),
		aggs:  make(map[string]struct{}),
	}
}
793159
func (s *Server) Register(id interface{}, f interface{}) {
	switch f.(type) {
	case func([]interface{}):
	case func([]interface{}) interface{}:
	case func([]interface{}) []interface{}:
	default:
		panic(fmt.Sprintf("function id %v: definition of function is invalid", id))
	}

	if _, ok := s.functions[id]; ok {
		panic(fmt.Sprintf("function id %v: already registered", id))
	}

	s.functions[id] = f
}
1331116
func (s *Scheme) AddGeneratedConversionFunc(a, b interface{}, fn conversion.ConversionFunc) error {
	return s.converter.RegisterGeneratedUntypedConversionFunc(a, b, fn)
}
1048162
func RegisterNodeNtfnHandlers(dcrdClient *rpcclient.Client) *ContextualError {
	// Set the node client for use by signalReorg to determine the common
	// ancestor of two chains.
	nodeClient = dcrdClient

	// Register for block connection and chain reorg notifications.
	var err error
	if err = dcrdClient.NotifyBlocks(); err != nil {
		return newContextualError("block notification "+
			"registration failed", err)
	}

	// Register for tx accepted into mempool ntfns
	if err = dcrdClient.NotifyNewTransactions(true); err != nil {
		return newContextualError("new transaction verbose notification registration failed", err)
	}

	// For OnNewTickets
	//  Commented since there is a bug in rpcclient/notify.go
	// dcrdClient.NotifyNewTickets()

	if err = dcrdClient.NotifyWinningTickets(); err != nil {
		return newContextualError("winning ticket "+
			"notification registration failed", err)
	}

	// Register a Tx filter for addresses (receiving).  The filter applies to
	// OnRelevantTxAccepted.
	// TODO: register outpoints (third argument).
	// if len(addresses) > 0 {
	// 	if err = dcrdClient.LoadTxFilter(true, addresses, nil); err != nil {
	// 		return newContextualError("load tx filter failed", err)
	// 	}
	// }

	return nil
}
1163571
func RegisterSassFunc(sign string, fn SassFunc) {
	ghMu.Lock()
	globalHandlers = append(globalHandlers, handler{
		sign:     sign,
		callback: SassHandler(fn),
	})
	ghMu.Unlock()
}