Skip to content

Commit

Permalink
[confighttp] Remove deprecated functions (open-telemetry#10138)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth authored and andrzej-stencel committed May 27, 2024
1 parent d23a62c commit ebdbf56
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
25 changes: 25 additions & 0 deletions .chloggen/confighttp-remove-deprecated-funcs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: confighttp

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Removes deprecated functions `ToClientContext`, `ToListenerContext`, and `ToServerContext`.

# One or more tracking issues or pull requests related to the change
issues: [10138]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
15 changes: 0 additions & 15 deletions config/confighttp/confighttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ func (hcs *ClientConfig) ToClient(ctx context.Context, host component.Host, sett
}, nil
}

// Deprecated: [v0.99.0] Use ToClient instead.
func (hcs *ClientConfig) ToClientContext(ctx context.Context, host component.Host, settings component.TelemetrySettings) (*http.Client, error) {
return hcs.ToClient(ctx, host, settings)
}

// Custom RoundTripper that adds headers.
type headerRoundTripper struct {
transport http.RoundTripper
Expand Down Expand Up @@ -286,11 +281,6 @@ type ServerConfig struct {
ResponseHeaders map[string]configopaque.String `mapstructure:"response_headers"`
}

// Deprecated: [v0.99.0] Use ToListener instead.
func (hss *ServerConfig) ToListenerContext(ctx context.Context) (net.Listener, error) {
return hss.ToListener(ctx)
}

// ToListener creates a net.Listener.
func (hss *ServerConfig) ToListener(ctx context.Context) (net.Listener, error) {
listener, err := net.Listen("tcp", hss.Endpoint)
Expand Down Expand Up @@ -341,11 +331,6 @@ func WithDecoder(key string, dec func(body io.ReadCloser) (io.ReadCloser, error)
}
}

// Deprecated: [v0.99.0] Use ToServer instead.
func (hss *ServerConfig) ToServerContext(ctx context.Context, host component.Host, settings component.TelemetrySettings, handler http.Handler, opts ...ToServerOption) (*http.Server, error) {
return hss.ToServer(ctx, host, settings, handler, opts...)
}

// ToServer creates an http.Server from settings object.
func (hss *ServerConfig) ToServer(_ context.Context, host component.Host, settings component.TelemetrySettings, handler http.Handler, opts ...ToServerOption) (*http.Server, error) {
internal.WarnOnUnspecifiedHost(settings.Logger, hss.Endpoint)
Expand Down

0 comments on commit ebdbf56

Please sign in to comment.