vanity

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Vanity Build Status GoDoc Go Report Card

Features

  • Redirects browsers to godoc.org
  • Redirects Go tool to VCS

Installation

go get kkn.fi/vanity/cmd/vanity

Configuration

Configuration example for Gorilla project:

/context  git https://github.com/gorilla/context
/mux  git https://github.com/gorilla/mux

Running

Script to run Gorilla toolkit's vanity domain server:

vanity -d gorillatoolkit.org -c vanity.conf

Specification

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	// Path is path component of vanity url.
	Path Path
	// VCSSystem is version control system used by the project.
	// Usually 'git' or 'hg'.
	VCSSystem string
	// VCSURL is the HTTP URL for project's version control system.
	VCSURL string
}

Package defines Go package that has vanity import defined.

func NewPackage added in v0.1.0

func NewPackage(path, vcssystem, vcsurl string) *Package

NewPackage returns a new Package given a path, VCS system and VCS URL.

type Path

type Path string

Path is the path component of the request sent by Go tool or browser.

type Server

type Server struct {
	// Domain is the vanity domain.
	Domain *string
	// Config contains settings for vanity packages.
	Config map[Path]Package
}

Server is the actual HTTP server for Go vanity domains.

func NewServer added in v0.1.0

func NewServer(domain string, config map[Path]Package) *Server

NewServer returns a new Vanity Server given domain name and vanity package configuration.

func (Server) ServeHTTP

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

Directories

Path Synopsis
cmd
vanity module

Jump to

Keyboard shortcuts

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