Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MimeTypeCar = "application/vnd.ipld.car" // The only accepted MIME type MimeTypeCarVersion = "1" // We only accept version 1 of the MIME type FormatParameterCar = "car" // The only valid format parameter value FilenameExtCar = ".car" // The only valid filename extension DefaultIncludeDupes = true // The default value for an unspecified "dups" parameter. See https://github.com/ipfs/specs/pull/412. ResponseAcceptRangesHeader = "none" // We currently don't accept range requests ResponseCacheControlHeader = "public, max-age=29030400, immutable" // Magic cache control values ResponseChunkDelimeter = []byte("0\r\n") // An http/1.1 chunk delimeter, used for specifying an early end to the response ResponseContentTypeHeader = fmt.Sprintf("%s; version=%s", MimeTypeCar, MimeTypeCarVersion) )
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
Click to show internal directories.
Click to hide internal directories.