client

package
v0.9.1-0...-94679d8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package client contains the client for the API exposed by system-probe

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotImplemented is an error used when system-probe is attempted to be accessed on an unsupported OS
	ErrNotImplemented = errors.New("system-probe unsupported")
)

Get returns a http client configured to talk to the system-probe

Functions

func DebugURL

func DebugURL(endpoint string) string

DebugURL constructs a system-probe URL for the debug module and endpoint.

func DialContextFunc

func DialContextFunc(socketPath string) func(context.Context, string, string) (net.Conn, error)

DialContextFunc returns a function to be used in http.Transport.DialContext for connecting to system-probe. The result will be OS-specific.

func GetCheck

func GetCheck[T any](client *http.Client, module types.ModuleName) (T, error)

GetCheck returns data unmarshalled from JSON to T, from the specified module at the /<module>/check endpoint.

func ModuleURL

func ModuleURL(module types.ModuleName, endpoint string) string

ModuleURL constructs a system-probe ModuleURL given the specified module and endpoint.

func ReadAllResponseBody

func ReadAllResponseBody(resp *http.Response) ([]byte, error)

ReadAllResponseBody reads the entire HTTP response body as a byte slice

func URL

func URL(endpoint string) string

URL constructs a system-probe URL for a module-less endpoint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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