mock_webserver

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

README

server/webserver/mocks

Import path: github.com/InsideGallery/core/server/webserver/mocks

mocks contains generated GoMock test doubles for server/webserver.

Main APIs

  • NewMockHTTPClient(ctrl): creates a generated mock for the legacy webserver.HTTPClient interface.
  • MockHTTPClient.EXPECT().Do(req): configures expectations for outbound Do(*http.Request) calls.

Usage

ctrl := gomock.NewController(t)
client := mock_webserver.NewMockHTTPClient(ctrl)

client.EXPECT().Do(gomock.Any()).Return(&http.Response{
	StatusCode: http.StatusOK,
	Body:       io.NopCloser(strings.NewReader("ok")),
}, nil)

Operational Notes

This package is generated by MockGen from server/webserver/client.go. It is a test support package, not a production API. Regenerate it instead of editing the generated source by hand.

Documentation

Overview

Package mock_webserver is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockHTTPClient

type MockHTTPClient struct {
	// contains filtered or unexported fields
}

MockHTTPClient is a mock of HTTPClient interface.

func NewMockHTTPClient

func NewMockHTTPClient(ctrl *gomock.Controller) *MockHTTPClient

NewMockHTTPClient creates a new mock instance.

func (*MockHTTPClient) Do

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

Do mocks base method.

func (*MockHTTPClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockHTTPClientMockRecorder

type MockHTTPClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockHTTPClientMockRecorder is the mock recorder for MockHTTPClient.

func (*MockHTTPClientMockRecorder) Do

func (mr *MockHTTPClientMockRecorder) Do(req interface{}) *gomock.Call

Do indicates an expected call of Do.

Jump to

Keyboard shortcuts

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