// ConnectionManager configures libp2p to use the given connection manager.
970295
func ConnectionManager(connman ifconnmgr.ConnManager) Option {
	return func(cfg *Config) error {
		if cfg.ConnManager != nil {
			return fmt.Errorf("cannot specify multiple connection managers")
		}
		cfg.ConnManager = connman
		return nil
	}
}
988506
func NewEventManager() EventManagers {
	em := EventManager{
		events:   make(map[string]EventSubs),
		attaches: make(map[EventManagers]bool),
	}

	return &em
}
675325
func ConfigureLimiter(lc *limiter.LimiterConfig) {
	lc.MaxConnections = LimiterMaxConnections
	lc.MaxNumberOfUsers = LimiterMaxConcurrentUsers
}
972546
func createManager(containerName string) *fs.Manager {
	allowAllDevices := true
	return &fs.Manager{
		Cgroups: &configs.Cgroup{
			Parent: "/",
			Name:   containerName,
			Resources: &configs.Resources{
				AllowAllDevices: &allowAllDevices,
			},
		},
	}
}
943759
func getPackageManager() (manager.PackageManager, error) {
	hostSeries, err := series.HostSeries()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return manager.NewPackageManager(hostSeries)
}
1191591
func newBGPManager(engine *Engine, interval time.Duration) *bgpManager {
	return &bgpManager{engine: engine, updateInterval: interval}
}
453058
func (in *IncomingConnection) AcceptConnection(opts ...ConnectionOption) Connection {
	return in.accept(func() Endpoint {
		for _, opt := range opts {
			opt(in.c)
		}
		in.c.pConnection.Open()
		return in.c
	}).(Connection)
}
1195609
func (c *ConnectionManager) AddConnection(xp rpc.Transporter, closeListener chan error) ConnectionID {
	c.Lock()
	c.nxt++ // increment first, since 0 is reserved
	id := c.nxt
	c.lookup[id] = &rpcConnection{transporter: xp}
	c.Unlock()

	if closeListener != nil {
		go func() {
			<-closeListener
			c.removeConnection(id)
		}()
	}

	return id
}
417293
func (c *Provider) IdentityManager(orgName string) (msp.IdentityManager, bool) {
	return c.idMgmtProvider.IdentityManager(orgName)
}
1097557
func (s *UpdateStackInput) SetConfigurationManager(v *StackConfigurationManager) *UpdateStackInput {
	s.ConfigurationManager = v
	return s
}
1100168
func (f *ProviderFactory) CreateIdentityManagerProvider(endpointConfig fab.EndpointConfig, cryptoProvider core.CryptoSuite, userStore msp.UserStore) (msp.IdentityManagerProvider, error) {
	return msppvdr.New(endpointConfig, cryptoProvider, userStore)
}
279158
func (s *CreateStackInput) SetConfigurationManager(v *StackConfigurationManager) *CreateStackInput {
	s.ConfigurationManager = v
	return s
}
770229
func (s *DescribeAgentVersionsInput) SetConfigurationManager(v *StackConfigurationManager) *DescribeAgentVersionsInput {
	s.ConfigurationManager = v
	return s
}
550772
func (c *ConfigLocal) KeyManager() KeyManager {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.keyman
}
218040
func ConnectionProblem(err error, message string, args ...interface{}) error {
	return WrapWithMessage(&ConnectionProblemError{
		Message: fmt.Sprintf(message, args...),
		Err:     err,
	}, message, args...)
}
1172109
func (cp *ProviderFactory) Provider(conn Connection) api.ConnectionProvider {
	return func(context.Client, fab.ChannelCfg, fab.Peer) (api.Connection, error) {
		return conn, nil
	}
}
660451
func NewManager(name string, opt Options) (*Manager, error) {
	p, ok := providers[name]
	if !ok {
		return nil, fmt.Errorf("session: unknown provider '%s'(forgotten import?)", name)
	}
	return &Manager{p, opt}, p.Init(opt.Maxlifetime, opt.ProviderConfig)
}