package
0.0.0-20241010070118-5bed1dfed891
Repository: https://github.com/trento-project/agent.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
MockMachineIDFile mocks the /etc/machine-id file to have a known value.

# Constants

No description provided by the author
No description provided by the author

# Type aliases

ErroringRoundTripFunc Needed to Mock Http client that returns an error even before the request is made Usage &http.Client{ Transport: helpers.ErroringRoundTripFunc(func() error { return fmt.Errorf("some error") }), }.
RoundTripFunc Needed to Mock Http client requests and responses Usage &http.Client{ Transport: helpers.RoundTripFunc(func(req *http.Request) *http.Response { bodyBytes, _ := ioutil.ReadAll(req.Body) suite.EqualValues(expectedBody, string(bodyBytes)) suite.Equal(req.URL.String(), expectedUrl) return &http.Response{ StatusCode: returnedStatusCode, } }), }.