httpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IpfsHandler

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 Sheltie server for fetching data from the network via HTTP

func NewHttpServer

func NewHttpServer(ctx context.Context, s *sheltie.Sheltie, 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

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