Git Product home page Git Product logo

goredirects's Introduction

goredirects Report card GoDoc

by Andrew Brampton (bramp.net)

goredirects enables the use of a vanity redirect domain in your go package imports. For example, instead of using import "github.com/example/package" you could use a vanity domain, and import "example.com/package", yet still host the source code on GitHub.

Specifically, this tool creates a set of HTML files containing the go-imports meta tags, for each of your projects. This uses the remote import paths feature of go get command to redirect from your vanity domain to GitHub.com.

Example

To create a set of static HTML redirects:

$ go install bramp.net/goredirects@latest

$ goredirects
Usage: goredirects <domain> <output dir>

$ goredirects bramp.net outputdir
# Looking under $GOROOT/src/bramp.net for all packages
...

This will search your $GOROOT/src/ for all packages, and create static HTML into the outputdir for each package.

To read more about how this tool works, checkout my blog article on the topic.

Licence (Apache 2)

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

Copyright 2017 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

goredirects's People

Contributors

bramp avatar dependabot[bot] avatar u5surf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

u5surf

goredirects's Issues

Add vendor skip option

@bramp any objection of adding a flag to omit parsing vendor if present ? Or just skip vendor by default. I don't think there is any advantage of generating vanity URLs for this. Let me know what you prefer.

Ability to configure git remote name

Currently the remote name origin is hard coded which is used to determine the http URLs. A command line flag to specify your own remote name would be great.

Start using gomodules

On a clean Go install, this won't install, specifically

$ go install bramp.net/goredirects
../../go/src/bramp.net/goredirects/goredirects.go:23:2: cannot find package "gopkg.in/src-d/go-git.v4" in any of:
	/usr/local/go/src/gopkg.in/src-d/go-git.v4 (from $GOROOT)
	/Users/bramp/go/src/gopkg.in/src-d/go-git.v4 (from $GOPATH)

You can fix this with

go get -v -u gopkg.in/src-d/go-git.v4/...

Setup something that install the deps automagically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.