handler

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinderHandler

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

FinderHandler provides request handling functionality for the finder server that is common to all protocols.

func NewFinderHandler

func NewFinderHandler(indexer indexer.Interface, registry *registry.Registry) *FinderHandler

func (*FinderHandler) MakeFindResponse

func (h *FinderHandler) MakeFindResponse(mhashes []multihash.Multihash) (*model.FindResponse, error)

MakeFindResponse reads from indexer core to populate a response from a list of multihashes.

type IngestHandler

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

IngestHandler provides request handling functionality for the ingest server that is common to all protocols

func NewIngestHandler

func NewIngestHandler(indexer indexer.Interface, registry *registry.Registry) *IngestHandler

func (*IngestHandler) DiscoverProvider

func (h *IngestHandler) DiscoverProvider(data []byte) error

func (*IngestHandler) GetProvider

func (h *IngestHandler) GetProvider(providerID peer.ID) ([]byte, error)

func (*IngestHandler) IndexContent

func (h *IngestHandler) IndexContent(ctx context.Context, data []byte) error

IndexContent handles an IngestRequest

Returning error is the same as return v0.NewError(err, http.StatusBadRequest)

func (*IngestHandler) ListProviders

func (h *IngestHandler) ListProviders() ([]byte, error)

func (*IngestHandler) RegisterProvider

func (h *IngestHandler) RegisterProvider(ctx context.Context, data []byte) error

Jump to

Keyboard shortcuts

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