Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock is a quick HTTP server that can be used to mock a Lacework API server, you can use it to avoid using a real server in our unit tests
A simple usage:
func TestSomethingNew(t *testing.T) { fakeServer := lacework.NewServer() fakeServer.MockToken("TOKEN") defer fakeServer.Close() // Make sure to pass the fake API server URL c, err := api.NewClient("test", api.WithURL(fakeServer.URL())) if assert.Nil(t, err) { // The client c is ready to be used } }
func (*Mock) MockAPI ¶
MockAPI will mock the api path inside the server mutex with the provided handler function
func (*Mock) MockTokenV2 ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.