favicon

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 6 Imported by: 103 modules, 101 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 Gin's middleware

Gin middleware to support favicon.

Usage

Start using it

Download and install it:

$ go get github.com/thinkerou/favicon

Import it in your code:

import "github.com/thinkerou/favicon"
Canonical example:
package main
            
import (
    "github.com/gin-gonic/gin"
    "github.com/thinkerou/favicon"
)
            
func main() {
    r := gin.Default()
    r.Use(favicon.New("./favicon.ico")) // set favicon middleware 

    r.GET("/ping", func(c *gin.Context) {
        c.String(200, "Hello favicon.")
    })

    r.Run(":8080")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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