server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const FindProvidersPath = "/routing/v1/providers/{cid}"
View Source
const ProvidePath = "/routing/v1/providers/"

Variables

This section is empty.

Functions

func Handler

func Handler(svc ContentRouter, opts ...serverOption) http.Handler

Types

type BitswapWriteProvideRequest

type BitswapWriteProvideRequest struct {
	Keys        []cid.Cid
	Timestamp   time.Time
	AdvisoryTTL time.Duration
	ID          peer.ID
	Addrs       []multiaddr.Multiaddr
}

type ContentRouter

type ContentRouter interface {
	FindProviders(ctx context.Context, key cid.Cid) ([]types.ProviderResponse, error)
	ProvideBitswap(ctx context.Context, req *BitswapWriteProvideRequest) (time.Duration, error)
	Provide(ctx context.Context, req *WriteProvideRequest) (types.ProviderResponse, error)
}

type WriteProvideRequest

type WriteProvideRequest struct {
	Protocol string
	Schema   string
	Bytes    []byte
}

Jump to

Keyboard shortcuts

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