coremock

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCore

type MockCore struct {
	Err   error
	Files map[string]string
	// contains filtered or unexported fields
}

MockCore can be used to bring up a simplified core-like service that you can upload and get files from.

func NewMockCore

func NewMockCore() *MockCore

NewMockCore returns a new MockCore with an empty set of Files.

func (*MockCore) GetFile

func (m *MockCore) GetFile(filename string) (string, bool)

GetFile thread-safe returns previously uploaded file contents by filename.

func (*MockCore) ServeHTTP

func (m *MockCore) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is to implement http.Handler so you can httptest.NewServer(m).

Jump to

Keyboard shortcuts

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