mockdelegatedrouter

package
v0.0.0-...-de8e8a8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDelegatedProvider

type MockDelegatedProvider struct {
	http.Server
	// contains filtered or unexported fields
}

A MockDelegatedProvider is the state of the http server acting as a counterparty to the HTTP delegated client.

func New

func New() *MockDelegatedProvider

New creates a mock provider that can serve as a counterpart to the http delegated content routing client

func (*MockDelegatedProvider) Add

func (m *MockDelegatedProvider) Add(c cid.Cid, peerAddr peer.AddrInfo, protocol uint64, md []byte) error

Add adds a record for the provider to return.

func (*MockDelegatedProvider) OnReq

func (m *MockDelegatedProvider) OnReq(resp http.ResponseWriter, req *http.Request)

OnReq handles requests from the http delegated routing client

Jump to

Keyboard shortcuts

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