mock

package
v0.0.0-...-4491fc4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(name string) string

Hash returns a base64-encoded sha256 hash of name.

Types

type ErrorHandler

type ErrorHandler struct{}

ErrorHandler is an HTTP handler that always responds with an Internal Server Error.

func (*ErrorHandler) Reset

func (h *ErrorHandler) Reset()

func (*ErrorHandler) ServeHTTP

func (h *ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IPFSAddHandler

type IPFSAddHandler struct{}

IPFSAddHandler is an HTTP handler that mocks the /api/v0/add enpoint of an IPFS Node.

func (*IPFSAddHandler) Reset

func (h *IPFSAddHandler) Reset()

func (*IPFSAddHandler) ServeHTTP

func (h *IPFSAddHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IPFSDAGImportErrorHandler

type IPFSDAGImportErrorHandler struct{}

IPFSDAGImportErrorHandler is an HTTP handler that returns PinErrorMsg for the /api/v0/dag/import enpoint.

func (*IPFSDAGImportErrorHandler) Reset

func (h *IPFSDAGImportErrorHandler) Reset()

func (*IPFSDAGImportErrorHandler) ServeHTTP

type IPFSDAGImportHandler

type IPFSDAGImportHandler struct{}

IPFSDAGImportHandler is an HTTP handler that mocks the /api/v0/dag/import enpoint of an IPFS Node.

func (*IPFSDAGImportHandler) Reset

func (h *IPFSDAGImportHandler) Reset()

func (*IPFSDAGImportHandler) ServeHTTP

func (h *IPFSDAGImportHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IPFSDAGImportNoRootHandler

type IPFSDAGImportNoRootHandler struct{}

IPFSDAGImportNoRootHandler is an HTTP handler that does not return root CID for the /api/v0/dag/import enpoint.

func (*IPFSDAGImportNoRootHandler) Reset

func (h *IPFSDAGImportNoRootHandler) Reset()

func (*IPFSDAGImportNoRootHandler) ServeHTTP

type IPFSPinRmHandler

type IPFSPinRmHandler struct {
	Invoked bool
	Removed []string
}

IPFSPinRmHandler is an HTTP handler that mocks the /api/v0/pin/rm enpoint of an IPFS Node.

func (*IPFSPinRmHandler) Reset

func (h *IPFSPinRmHandler) Reset()

func (*IPFSPinRmHandler) ServeHTTP

func (h *IPFSPinRmHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NoopHandler

type NoopHandler struct{}

NoopHandler is an HTTP handler that does not do anything.

func (*NoopHandler) Reset

func (h *NoopHandler) Reset()

func (*NoopHandler) ServeHTTP

func (h *NoopHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ResettableHandler

type ResettableHandler interface {
	http.Handler
	Reset()
}

ResettableHandler is an HTTP handler that can reset its internal state.

Jump to

Keyboard shortcuts

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