favicon

package module
v0.0.0-...-0951e12 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2016 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

favicon

Build Status Coverage Status

Go http middleware for serving the favicon.

Installation

go get -u github.com/go-http-utils/favicon

Documentation

API documentation can be found here: https://godoc.org/github.com/go-http-utils/favicon

Usage

import (
  "github.com/go-http-utils/favicon"
)
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
  res.Write([]byte("Hello World"))
})

http.ListenAndServe(":8080", favicon.Handler(mux, "./public/favicon.ico"))

Documentation

Overview

Example
package main

import (
	"net/http"

	"github.com/go-http-utils/favicon"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
		res.Write([]byte("Hello World"))
	})

	http.ListenAndServe(":8080", favicon.Handler(mux, "./public/favicon.ico"))
}

Index

Examples

Constants

View Source
const Version = "0.1.0"

Version is this package's version.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler, path string) http.Handler

Handler wraps the http.Handler h with favicon support. `path` is the path to find the favicon.

Types

This section is empty.

Jump to

Keyboard shortcuts

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