vanity: kkn.fi/vanity Index | Examples | Files

package vanity

import "kkn.fi/vanity"

Index

Examples

Package Files

vanity.go

func Redirect Uses

func Redirect(vcs, importPath, repoRoot string) http.Handler

Redirect is a HTTP middleware that redirects browsers to godoc.org or Go tool to VCS repository.

Code:

http.Handle("/", vanity.Redirect("git", "kkn.fi", "github.com/kare"))

func SetLogger Uses

func SetLogger(l Logger)

SetLogger sets the logger used by vanity package's error log.

Code:

errorLog := log.New(os.Stderr, "vanity: ", log.Ldate|log.Ltime|log.LUTC)
vanity.SetLogger(errorLog)

type Logger Uses

type Logger interface {
    Printf(format string, v ...interface{})
}

Logger describes functions available for logging purposes.

Package vanity imports 4 packages (graph). Updated 2018-12-04. Refresh now. Tools for package owners.