Documentation ¶
Overview ¶
Package httzip allows you to connect a zip archive to the web server as static files handler.
Example ¶
package main import ( "log" "net/http" "github.com/mdigger/httpzip" ) func main() { // open zip-file zipServer, err := httpzip.Open("static.zip") if err != nil { log.Fatal(err) } defer zipServer.Close() // initialize http handler http.Handle("/static/", http.StripPrefix("/static/", zipServer)) }
Output:
Index ¶
- Variables
- type HTTPZip
- func (h *HTTPZip) Close() error
- func (h *HTTPZip) GetData(name string) ([]byte, error)
- func (h *HTTPZip) GetMimeType() string
- func (h *HTTPZip) Open(name string) (*openedFile, error)
- func (h *HTTPZip) ServeFile(w http.ResponseWriter, r *http.Request, name string)
- func (h *HTTPZip) ServeHTTP(w http.ResponseWriter, r *http.Request)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("httpzip: client closed")
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.