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 *http.Request) *http.Request
- func WithContext(ctx context.Context) ipc.RequestOption
- func WithLeaveConnectionOpen(req *http.Request) *http.Request
- 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 ¶
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 ¶
WithLeaveConnectionOpen is a request option that leaves the connection open after 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
Click to show internal directories.
Click to hide internal directories.