content

package
v0.0.0-...-891d2fd Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause, BSD-3-Clause Imports: 4 Imported by: 0

README

content

GoDoc

This package defines a content serving request handler, allowing to serve http range requests.

Dependencies

These are the only two external dependencies required as they are necessary to take into account the execution context of a request-handling goroutine.

License

BSD 3-clause

Documentation

Overview

Package content enables one to serve a data range out of a http requested file. It is useful for media that are susceptible to a range request such as audio or video files.

Example: https://stackoverflow.com/questions/8293687/sample-http-range-request-session

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an adapter for xhttp of a net/http handler that serves content. For further information, please refer to https://golang.org/pkg/net/http/#ServeContent

func NewServer

func NewServer(name string, modtime time.Time, content io.ReadSeeker) Server

NewServer returns a http request handler in charge of serving content.

Link registers a next request Handler to be called by ServeHTTP method. It returns the result of the linking.

func (Server) ServeHTTP

func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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