// InitSyncWithProvider inits global logger(async) with a specified provider
355827
func InitSyncWithProvider(p logger.Provider) error {
	l := logger.NewSync(p)
	l.SetLevel(LvINFO)
	return InitWithLogger(l)
}
668134
func WithProviders(providers ...common.Provider) *ProviderList {
	GetSecurityKey()
	list := &ProviderList{providers}
	SharedProviderList = list
	return list
}
595234
func NewProvider(tagname string) dependency.Provider {
	return &Provider{
		injectors:        []dependency.Injector{},
		defaultFactories: map[string]dependency.Factory{},
		factories:        map[string]dependency.Factory{},
		defaultInstances: map[string]interface{}{},
		instances:        map[string]interface{}{},
		callstack:        []string{},
		keys:             []string{},
		blocked:          false,
		autoclean:        true,
		tagname:          tagname,
	}
}
1220283
func NewProvider(constructor interface{}, argPtrs ...interface{}) Provider {
	fnValue := reflect.ValueOf(constructor)
	if fnValue.Kind() != reflect.Func {
		panic(fmt.Sprintf("constructor (%v) is not a function, found %v", fnValue, fnValue.Kind()))
	}

	fnType := reflect.TypeOf(constructor)
	if fnType.NumOut() != 1 {
		panic(fmt.Sprintf("constructor must have exactly 1 return value, found %v", fnType.NumOut()))
	}

	argCount := fnType.NumIn()
	if !fnValue.Type().IsVariadic() && argCount != len(argPtrs) {
		panic(fmt.Sprintf("argPtrs (%d) must match constructor arguments (%d)", len(argPtrs), argCount))
	}

	var kind reflect.Kind
	for i, argPtr := range argPtrs {
		isVariadic := fnValue.Type().IsVariadic() && (fnType.NumIn() == 1 || i >= fnType.NumIn())

		if i < fnType.NumIn() {
			kind = fnType.In(i).Kind()
		} else {
			kind = fnType.In(fnType.NumIn() - 1).Kind()
		}

		if reflect.TypeOf(argPtr).Kind() != reflect.Ptr {
			panic(fmt.Sprintf("argPtrs must all be pointers, found %v", reflect.TypeOf(argPtr)))
		}

		if !isVariadic && reflect.ValueOf(argPtr).Elem().Kind() != kind {
			panic("argPtrs must match constructor argument types")
		}
	}

	return provider{
		constructor: constructor,
		argPtrs:     argPtrs,
	}
}
514168
func (c *Configuration) InitACMEProvider() (*acmeprovider.Provider, error) {
	if c.ACME != nil {
		if len(c.ACME.Storage) == 0 {
			return nil, errors.New("unable to initialize ACME provider with no storage location for the certificates")
		}
		return &acmeprovider.Provider{
			Configuration: c.ACME,
		}, nil
	}
	return nil, nil
}
951434
func NewProvider(config ProviderConfig) (environs.CloudEnvironProvider, error) {
	environProvider, err := NewEnvironProvider(config)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return environProvider, nil
}
1117197
func NewProviderAggregator(conf static.Providers) ProviderAggregator {
	p := ProviderAggregator{}

	if conf.File != nil {
		p.quietAddProvider(conf.File)
	}

	if conf.Docker != nil {
		p.quietAddProvider(conf.Docker)
	}

	if conf.Marathon != nil {
		p.quietAddProvider(conf.Marathon)
	}

	if conf.Rest != nil {
		p.quietAddProvider(conf.Rest)
	}

	if conf.Kubernetes != nil {
		p.quietAddProvider(conf.Kubernetes)
	}

	if conf.KubernetesCRD != nil {
		p.quietAddProvider(conf.KubernetesCRD)
	}
	if conf.Rancher != nil {
		p.quietAddProvider(conf.Rancher)
	}

	return p
}
1304851
func initVerifier(ctx context.Context, config *oidc.Config, iss string) (*oidc.IDTokenVerifier, error) {
	provider, err := oidc.NewProvider(ctx, iss)
	if err != nil {
		return nil, fmt.Errorf("init verifier failed: %v", err)
	}
	return provider.Verifier(config), nil
}
150760
func InitWithLogger(l logger.Logger) error {
	glogger.Quit()
	glogger = l
	glogger.Run()
	return nil
}
1218854
func (srv *Instance) RegisterRegistrationProvider(ctx context.Context, wg *sync.WaitGroup, provider registration.RegistrationDataProvider) error {
	return srv.registration.RegisterProvider(ctx, wg, provider)
}
936679
func (m *RegistryMemory) WithOAuth2Provider(f fosite.OAuth2Provider) *RegistryMemory {
	m.RegistryBase.fop = f
	return m
}
539291
func (p *Provider) Init() error {
	fm := template.FuncMap{
		"strsToItfs": func(values []string) []interface{} {
			var r []interface{}
			for _, v := range values {
				r = append(r, v)
			}
			return r
		},
	}

	defaultRuleTpl, err := provider.MakeDefaultRuleTemplate(p.DefaultRule, fm)
	if err != nil {
		return fmt.Errorf("error while parsing default rule: %v", err)
	}

	p.defaultRuleTpl = defaultRuleTpl
	return nil
}
323179
func LoginProvider(ctx context.Context) string {
	name, _ := LoginProviderFrom(ctx)
	return name
}
1088070
func WithChannelProvider(channelProvider fab.ChannelProvider) SDKContextParams {
	return func(ctx *Provider) {
		ctx.channelProvider = channelProvider
	}
}
157790
func GetProvider(name string) (Provider, error) {
	provider := providers[name]
	if provider == nil {
		return nil, fmt.Errorf("no provider for %s exists", name)
	}
	return provider, nil
}
56473
func (s *RulesPackage) SetProvider(v string) *RulesPackage {
	s.Provider = &v
	return s
}
1129190
func WithIdentityManagerProvider(provider msp.IdentityManagerProvider) SDKContextParams {
	return func(ctx *Provider) {
		ctx.idMgmtProvider = provider
	}
}