openstack

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

Openstack Cloudmock

Design

Because the gophercloud library does not provide client interfaces whose client-side functions could be mocked like aws-sdk-go, this cloudmock uses a local HTTP server and updates state based on incoming requests from the gophercloud clients. This is how the gophercloud library tests themselves are implemented.

Each package represents one of the Openstack service clients and contains its own net/http/httptest server. Each package defines the endpoints for that client's resources.

Troubleshooting

One recommended way to troubleshoot requests and responses is with Wireshark or an equivalent, monitoring the loopback interface.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOpenstackServer

type MockOpenstackServer struct {
	Mux *http.ServeMux

	Server *httptest.Server
}

func (*MockOpenstackServer) ServiceClient

func (m *MockOpenstackServer) ServiceClient() *gophercloud.ServiceClient

func (*MockOpenstackServer) SetupMux

func (m *MockOpenstackServer) SetupMux()

SetupMux prepares the Mux and Server.

func (*MockOpenstackServer) TeardownHTTP

func (m *MockOpenstackServer) TeardownHTTP()

TeardownHTTP releases HTTP-related resources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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