// NewHTTPProvider returns a HTTPProvider instance with a configured webroot path
423045
func NewHTTPProvider(path string) (*HTTPProvider, error) {
	if _, err := os.Stat(path); os.IsNotExist(err) {
		return nil, fmt.Errorf("webroot path does not exist")
	}

	return &HTTPProvider{path: path}, nil
}
298730
func NewProvider(config *ProviderConfig) (*Provider, error) {
	if err := validateConfig(config); err != nil {
		return nil, err
	}

	// Create logger
	if config.LogOutput == nil {
		config.LogOutput = os.Stderr
	}
	logger := log.New(config.LogOutput, "", log.LstdFlags)

	p := &Provider{
		config:     config,
		logger:     logger,
		shutdownCh: make(chan struct{}),
	}
	go p.run()
	return p, nil
}
36695
func NewMultiProvider(base content.Provider) *MultiProvider {
	return &MultiProvider{
		base: base,
		sub:  map[digest.Digest]content.Provider{},
	}
}
304804
func NewProvider(params ...SDKContextParams) *Provider {
	ctxProvider := Provider{}
	for _, param := range params {
		param(&ctxProvider)
	}
	return &ctxProvider
}
1316750
func NewHTTPServer(s *http.Server) *HTTPServer {
	return &HTTPServer{
		Server: s,
		done:   make(chan error, 1),
	}
}
452808
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get("NAMECOM_USERNAME", "NAMECOM_API_TOKEN")
	if err != nil {
		return nil, fmt.Errorf("namedotcom: %v", err)
	}

	config := NewDefaultConfig()
	config.Username = values["NAMECOM_USERNAME"]
	config.APIToken = values["NAMECOM_API_TOKEN"]
	config.Server = env.GetOrFile("NAMECOM_SERVER")

	return NewDNSProviderConfig(config)
}
1329422
func (b *BigIP) CreateHttpProfile(name string, parent string) error {
	config := &HttpProfile{
		Name:         name,
		DefaultsFrom: parent,
	}

	return b.post(config, uriLtm, uriProfile, uriHttp)
}
677336
func NewProvider(calculateHints bool) Provider {
	return &Store{
		calculateHints: calculateHints,
		metrics:        make(map[string][]time.Duration),
		diffs:          make(map[string]*diff),
	}
}
200314
func NewProvider(issuer string, clientIDs []string) (Provider, error) {
	p := Provider{issuer, clientIDs}

	if err := p.validate(); err != nil {
		return Provider{}, err
	}

	return p, nil
}
22714
func NewProvider() Server {
	return Server{
		server: rpc.NewServer(),
		rwc:    rwCloser{os.Stdin, os.Stdout},
	}
}
386717
func NewHTTPProvider(chainID, remote string) lite.Provider {
	return NewProvider(chainID, rpcclient.NewHTTP(remote, "/websocket"))
}
268812
func NewLocalProvider(config fab.EndpointConfig) (*LocalProvider, error) {
	return &LocalProvider{config: config}, nil
}
926413
func NewProvider(ctx context.Context, issuer string) (*Provider, error) {
	wellKnown := strings.TrimSuffix(issuer, "/") + "/.well-known/openid-configuration"
	req, err := http.NewRequest("GET", wellKnown, nil)
	if err != nil {
		return nil, err
	}
	resp, err := doRequest(ctx, req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, fmt.Errorf("unable to read response body: %v", err)
	}

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("%s: %s", resp.Status, body)
	}

	var p providerJSON
	err = unmarshalResp(resp, body, &p)
	if err != nil {
		return nil, fmt.Errorf("oidc: failed to decode provider discovery object: %v", err)
	}

	if p.Issuer != issuer {
		return nil, fmt.Errorf("oidc: issuer did not match the issuer returned by provider, expected %q got %q", issuer, p.Issuer)
	}
	return &Provider{
		issuer:       p.Issuer,
		authURL:      p.AuthURL,
		tokenURL:     p.TokenURL,
		userInfoURL:  p.UserInfoURL,
		rawClaims:    body,
		remoteKeySet: NewRemoteKeySet(ctx, p.JWKSURL),
	}, nil
}
274434
func NewProviderServer(iface, port string) *ProviderServer {
	return &ProviderServer{iface: iface, port: port}
}
1164270
func NewHTTPHandler(tracer opentracing.Tracer, service Service) http.Handler {
	// Create our HTTP Service.
	svc := &httpService{service: service}

	// Create the mux.
	mux := http.NewServeMux()

	// Create the Sum handler.
	var sumHandler http.Handler
	sumHandler = http.HandlerFunc(svc.sumHandler)

	// Wrap the Sum handler with our tracing middleware.
	sumHandler = middleware.FromHTTPRequest(tracer, "Sum")(sumHandler)

	// Wire up the mux.
	mux.Handle("/sum/", sumHandler)

	// Return the mux.
	return mux
}
543784
func NewHTTPTransporter(upid upid.UPID, address net.IP, opts ...httpOpt) *HTTPTransporter {
	transport := httpTransport
	client := HttpClient
	client.Transport = &transport
	mux := http.NewServeMux()

	result := &HTTPTransporter{
		upid:         upid,
		messageQueue: make(chan *Message, defaultQueueSize),
		mux:          mux,
		client:       &client,
		tr:           &transport,
		address:      address,
		shouldQuit:   make(chan struct{}),
		server: &http.Server{
			ReadTimeout:  ReadTimeout,
			WriteTimeout: WriteTimeout,
			Handler:      mux,
		},
	}
	for _, f := range opts {
		f(result)
	}
	result.state = &notStartedState{result}
	return result
}
886652
func NewDNSProvider() (*DNSProvider, error) {
	config := NewDefaultConfig()

	endpoint, err := url.Parse(env.GetOrDefaultString("EASYDNS_ENDPOINT", defaultEndpoint))
	if err != nil {
		return nil, fmt.Errorf("easydns: %v", err)
	}
	config.Endpoint = endpoint

	values, err := env.Get("EASYDNS_TOKEN", "EASYDNS_KEY")
	if err != nil {
		return nil, fmt.Errorf("easydns: %v", err)
	}

	config.Token = values["EASYDNS_TOKEN"]
	config.Key = values["EASYDNS_KEY"]

	return NewDNSProviderConfig(config)
}