httphelpers

package module
v0.86.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 20 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httphelpers implements helpers for HTTP communication between Agent processes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(authToken string, clientTLSConfig *tls.Config, config pkgconfigmodel.Reader) ipc.HTTPClient

NewClient creates a new secure client

func NewHTTPMiddleware

func NewHTTPMiddleware(logger func(format string, params ...interface{}), authtoken string) func(http.Handler) http.Handler

NewHTTPMiddleware returns a middleware that validates the auth token for the given request

func WithCloseConnection

func WithCloseConnection(req *ipc.RequestParams)

WithCloseConnection is a request option that closes the connection after the request

func WithContext

func WithContext(ctx context.Context) ipc.RequestOption

WithContext is a request option that sets the context for the request

func WithLeaveConnectionOpen

func WithLeaveConnectionOpen(req *ipc.RequestParams)

WithLeaveConnectionOpen is a request option that leaves the connection open after the request

func WithTimeout

func WithTimeout(timeout time.Duration) ipc.RequestOption

WithTimeout is a request option that sets the timeout for the request

func WithValues

func WithValues(values url.Values) ipc.RequestOption

WithValues is a request option that sets the values for the request

func WithoutAuthToken added in v0.84.0

func WithoutAuthToken(req *ipc.RequestParams)

WithoutAuthToken skips attaching the IPC bearer token to the request. Use for unauthenticated endpoints (expvar, pprof, /telemetry) that do not verify the token.

Types

type IPCEndpoint

type IPCEndpoint struct {
	// contains filtered or unexported fields
}

IPCEndpoint is an endpoint that IPC requests will be sent to

func (*IPCEndpoint) DoGet

func (end *IPCEndpoint) DoGet(options ...ipc.RequestOption) ([]byte, error)

DoGet sends GET method to the endpoint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL