httpserver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0, MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 shutsdown 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
	Metrics             bool
}

Jump to

Keyboard shortcuts

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