mockclient

package
v1.6.11-integrations Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetDoFunc - mock client's `Do` func
	GetDoFunc func(req *http.Request) (*http.Response, error)
	// CheckConnection - mock client's `CheckConnection` func
	CheckConnection func() error
	// GetDescriptions - mock client's `RequestDescriptions` func
	GetDescriptions func(descriptionIDs []string) (map[string]model.CISDescriptions, error)
	// CheckVersion mock client's `CheckLatestVersion` func
	CheckVersion func(version string) (genModel.Version, error)
)

Functions

This section is empty.

Types

type MockDescriptionsClient added in v1.6.8

type MockDescriptionsClient struct {
	RequestDescriptionsFunc func(descriptionIDs []string) (map[string]model.CISDescriptions, error)
}

MockDescriptionsClient - the mock CIS descriptions client

func (*MockDescriptionsClient) CheckConnection added in v1.6.8

func (m *MockDescriptionsClient) CheckConnection() error

CheckConnection - mock CIS descriptions client check connection function

func (*MockDescriptionsClient) CheckLatestVersion added in v1.6.8

func (m *MockDescriptionsClient) CheckLatestVersion(version string) (genModel.Version, error)

CheckLatestVersion - mock client request version function

func (*MockDescriptionsClient) RequestDescriptions added in v1.6.8

func (m *MockDescriptionsClient) RequestDescriptions(descriptionIDs []string) (map[string]model.CISDescriptions, error)

RequestDescriptions - mock descriptions client request descriptions function

type MockHTTPClient

type MockHTTPClient struct {
	DoFunc func(req *http.Request) (*http.Response, error)
}

MockHTTPClient - the mock http client

func (*MockHTTPClient) Do

func (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error)

Do - mock clients do function

type MockRequestBody

type MockRequestBody struct {
	Descriptions []string `json:"descriptions"`
}

MockRequestBody - mock request body

type MockResponseBody

type MockResponseBody struct {
	Descriptions map[string]string `json:"descriptions"`
}

MockResponseBody - mock response body

Jump to

Keyboard shortcuts

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