Documentation
¶
Overview ¶
Package httphelpers implements helpers for HTTP communication between Agent processes
Index ¶
- func NewClient(authToken string, clientTLSConfig *tls.Config, config pkgconfigmodel.Reader) ipc.HTTPClient
- func NewHTTPMiddleware(logger func(format string, params ...interface{}), authtoken string) func(http.Handler) http.Handler
- func WithCloseConnection(req *ipc.RequestParams)
- func WithContext(ctx context.Context) ipc.RequestOption
- func WithLeaveConnectionOpen(req *ipc.RequestParams)
- func WithTimeout(timeout time.Duration) ipc.RequestOption
- func WithValues(values url.Values) ipc.RequestOption
- type IPCEndpoint
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