Documentation ¶
Overview ¶
Package client contains the client for the API exposed by system-probe
Index ¶
- Variables
- func DebugURL(endpoint string) string
- func DialContextFunc(socketPath string) func(context.Context, string, string) (net.Conn, error)
- func GetCheck[T any](client *http.Client, module types.ModuleName) (T, error)
- func ModuleURL(module types.ModuleName, endpoint string) string
- func ReadAllResponseBody(resp *http.Response) ([]byte, error)
- func URL(endpoint string) string
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") )
View Source
var Get = funcs.MemoizeArgNoError[string, *http.Client](get)
Get returns a http client configured to talk to the system-probe
Functions ¶
func DialContextFunc ¶
DialContextFunc returns a function to be used in http.Transport.DialContext for connecting to system-probe. The result will be OS-specific.
func GetCheck ¶
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 ¶
ReadAllResponseBody reads the entire HTTP response body as a byte slice
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.