httpserver

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0, MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IpfsHandler added in v0.18.0

func IpfsHandler(fetcher types.Fetcher, cfg HttpServerConfig) func(http.ResponseWriter, *http.Request)

Types

type HttpServer

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

HttpServer is a Lassie server for fetching data from the network via HTTP

func NewHttpServer

func NewHttpServer(ctx context.Context, lassie *lassie.Lassie, cfg HttpServerConfig) (*HttpServer, error)

NewHttpServer creates a new HttpServer

func (HttpServer) Addr

func (s HttpServer) Addr() string

Addr returns the listening address of the server

func (*HttpServer) Close

func (s *HttpServer) Close() error

Close shuts down the server and cancels the server context

func (*HttpServer) Start

func (s *HttpServer) Start() error

Start starts the http server, returning an error if the server failed to start

type HttpServerConfig added in v0.4.4

type HttpServerConfig struct {
	Address             string
	Port                uint
	TempDir             string
	MaxBlocksPerRequest uint64
	AccessToken         string
}

Jump to

Keyboard shortcuts

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