-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
provider.go
29 lines (25 loc) · 1.01 KB
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package httpprovider // import "go.opentelemetry.io/collector/confmap/provider/httpprovider"
import (
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/provider/internal/configurablehttpprovider"
)
// NewWithSettings returns a new confmap.Provider that reads the configuration from a http server.
//
// This Provider supports "http" scheme.
//
// One example for HTTP URI is: http://localhost:3333/getConfig
//
// Deprecated: [v0.99.0] Use NewFactory instead.
func NewWithSettings(set confmap.ProviderSettings) confmap.Provider {
return configurablehttpprovider.New(configurablehttpprovider.HTTPScheme, set)
}
// NewFactory returns a factory for a confmap.Provider that reads the configuration from a http server.
//
// This Provider supports "http" scheme.
//
// One example for HTTP URI is: http://localhost:3333/getConfig
func NewFactory() confmap.ProviderFactory {
return confmap.NewProviderFactory(NewWithSettings)
}