point

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 16 Imported by: 0

README

point

Create and manage shortened URLs with GitHub pages.

point lets you create, view, and manage shortened URLs. All pages are hosted on GitHub Pages and redirection is done with HTML5's http-equiv refresh attribute.

Demo

asciicast

Installation

  • You should have Go installed and configured.

  • Install with Go:

    $ go get -v github.com/kshvmdn/point/...
    $ point --help
    
  • Or, install directly via source:

    $ git clone https://github.com/kshvmdn/point.git $GOPATH/src/github.com/kshvmdn/point
    $ cd $_
    $ make bootstrap install
    $ point --help
    

Usage

  • You should export your personal GitHub access token as POINT_ACCESS_TOKEN. You can request one here with the repo and delete_repo permissions.

  • View the help dialogue with the --help flag. View the specific help dialogue for each command by running point [command] --help.

    $ point --help
    usage: point [<flags>] <command> [<args> ...]
    
    Create and manage shortened URLs with GitHub pages.
    
    Flags:
      --help     Show context-sensitive help (also try --help-long and --help-man).
      --verbose  Show detailed output.
      --version  Show application version.
    
    Commands:
      help [<command>...]
        Show help.
    
      create [<flags>] <url>
        Create a new entry.
    
      list
        Print a list of active entries.
    
      remove <repo>...
        Remove one or more entries.
    
    
  • create

    $ point create --help
    usage: point create [<flags>] <url>
    
    Create a new entry.
    
    Flags:
          --help         Show context-sensitive help (also try --help-long and --help-man).
          --verbose      Show detailed output.
          --version      Show application version.
      -c, --cname=CNAME  Optional CNAME record for this repository.
      -n, --name=NAME    Endpoint for the shortened URL, chosen randomly if empty.
      -p, --private      Make this repository private.
      -s, --subdir       Use a subdirectory in a pre-existing repository, instead of creating a new repository.
      -r, --repo=REPO    A pre-existing repository to be used with the --subdir option (expects `foo/bar` for
                         `https://github.com/foo/bar`). Pushes to the default branch.
    
    Args:
      <url>  The URL to shorten.
    
    
  • list

    $ point list --help
    usage: point list
    
    Print a list of active entries.
    
    Flags:
      --help     Show context-sensitive help (also try --help-long and --help-man).
      --verbose  Show detailed output.
      --version  Show application version.
    
    
  • remove

    $ point remove --help
    usage: point remove <repo>...
    
    Remove one or more entries.
    
    Flags:
      --help     Show context-sensitive help (also try --help-long and --help-man).
      --verbose  Show detailed output.
      --version  Show application version.
    
    Args:
      <repo>  List of entries to remove.
    
    

Contribute

This project is completely open source. Feel free to open an issue or create a pull request.

Before submitting code, please ensure that tests are passing and the linter is happy. The following commands may be of use, refer to the Makefile to see what they do.

$ make bootstrap \
       install
$ make fmt \
       vet \
       lint
$ make test \
       coverage
$ make bootstrap-dist \
       dist

License

point source code is released under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(r Runner, accessToken string) (err error)

Start creates a new client and invokes the runner's run method.

Types

type Creator

type Creator struct {
	URL     string
	Name    string
	CNAME   string
	Private bool
	Repo    string
	Subdir  bool
	Verbose bool
}

Creator implements Runner for the create operation.

type Lister

type Lister struct{}

Lister implements Runner for the list operation.

type Remover

type Remover struct {
	Repos   []string
	Verbose bool
}

Remover implements Runner for the remove operation.

type Runner

type Runner interface {
	// contains filtered or unexported methods
}

Runner is an interface representing a point operation.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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