httphelpers

package module
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 17 Imported by: 3

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 added in v0.68.0

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

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