gopkgr

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

gopkg

A Caddy plugin to add gopkg-like functionality to your own web sites.

Usage

gopkg [path] [repo-uri]

gopkg [path] [vcs] [repo-uri]

zikes.me {
  // default vcs is git
  gopkg /multistatus https://github.com/zikes/multistatus
  gopkg /chrisify https://github.com/zikes/chrisify

  // use mercurial
  gopkg /myrepo hg https://bitbucket.org/zikes/myrepo
}

The above would make the repos go get-able via go get zikes.me/chrisify, go get zikes.me/myrepo, and go get zikes.me/multistatus.

If the urls are visited normally the browser will be redirected to the repo uri.

Once implemented, go get can enforce your import paths with import path checking.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string
	Vcs  string
	Uri  string
}

type GopkgHandler

type GopkgHandler struct {
	Next    httpserver.Handler
	Configs []Config
}

func (GopkgHandler) ServeHTTP

func (g GopkgHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

Jump to

Keyboard shortcuts

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