Go Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
cmd
docs
env
pkg
vendor
.gitattributes
.gitignore
.goreleaser.yml
.scrutinizer.yml
.travis.yml
Gopkg.lock
Gopkg.toml
LICENSE
Makefile
README.md
main.go
main_test.go

README.md

Click! Tweet

Analytics Link Manager as a Service — your personal link storage and URL shortener.

Patreon Build Status Code Coverage Code Quality License

Roadmap

Motivation

  • We need better integration with static site generators like Hugo.
  • We want better products than Bitly or Ow.ly.
  • We have to full control over our users' data and protect it from third parties.

Quick start

Requirements:

  • Docker 17.09.0-ce or above
  • Docker Compose 1.16.1 or above
  • Go 1.9.2 or above
  • GNU Make 3.81 or above
$ make up demo status

     Name                    Command               State                                  Ports
-------------------------------------------------------------------------------------------------------------------------------
click_db_1        docker-entrypoint.sh postgres    Up      0.0.0.0:5432->5432/tcp
click_server_1    /bin/sh -c envsubst '$SERV ...   Up      80/tcp, 0.0.0.0:80->8080/tcp
click_service_1   click run --with-profiling ...   Up      0.0.0.0:8080->80/tcp, 0.0.0.0:8090->8090/tcp, 0.0.0.0:8091->8091/tcp

$ curl http://localhost:8080/api/v1/a382922d-b615-4227-b598-6d3633c397aa
# {
#   "id": "a382922d-b615-4227-b598-6d3633c397aa",
#   "name": "Click! - Link Manager as a Service",
#   "status": "active",
#   "aliases": [
#     {
#       "id": 1,
#       "namespace": "global",
#       "urn": "github/click"
#     },
#     {
#       "id": 7,
#       "namespace": "global",
#       "urn": "github/click!"
#     }
#   ],
#   "targets": [
#     {
#       "id": 1,
#       "uri": "https://github.com/kamilsk/click",
#       "rule": {
#         "description": "Project location",
#         "tags": ["src"]
#       }
#     },
#     {
#       "id": 2,
#       "uri": "https://kamilsk.github.io/click/",
#       "rule": {
#         "description": "Promotion page",
#         "alias": 7,
#         "tags": ["promo"],
#         "match": 1
#       }
#     }
#   ]
# }
$ curl -v --cookie "token=41ca5e09-3ce2-4094-b108-3ecc257c6fa4" http://localhost:8080/github/click!
# > GET /github/click! HTTP/1.1
# > Host: localhost:8080
# > User-Agent: curl/7.54.0
# > Accept: */*
# > Cookie: token=41ca5e09-3ce2-4094-b108-3ecc257c6fa4
# >
# < HTTP/1.1 302 Found
# < Location: https://kamilsk.github.io/click/
# < Set-Cookie: token=41ca5e09-3ce2-4094-b108-3ecc257c6fa4; Path=/; HttpOnly; Secure
# < Date: Wed, 11 Apr 2018 17:37:48 GMT
# < Content-Length: 0
# <

Specification

API

You can find API specification here. Also, we recommend using Insomnia HTTP client to work with the API - you can import data for it from the file.

CLI

$ click --help
Click!

Usage:
  click [command]

Available Commands:
  completion  Print Bash or Zsh completion
  help        Help about any command
  migrate     Apply database migration
  run         Start HTTP server
  version     Show application version

Flags:
  -h, --help   help for click

Use "click [command] --help" for more information about a command.

Bash and Zsh completions

You can find completion files here or build your own using these commands

$ click completion -f bash > /path/to/bash_completion.d/click.sh
$ click completion -f zsh  > /path/to/zsh-completions/_click.zsh

Installation

Brew

$ brew install kamilsk/tap/click

Binary

$ export VER=1.0.0      # all available versions are on https://github.com/kamilsk/click/releases
$ export REQ_OS=Linux   # macOS and Windows are also available
$ export REQ_ARCH=64bit # 32bit is also available
$ wget -q -O click.tar.gz \
       https://github.com/kamilsk/click/releases/download/"${VER}/click_${VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf click.tar.gz -C "${GOPATH}"/bin/ && rm click.tar.gz

Docker Hub

$ docker pull kamilsk/click:1.x

From source code

$ egg github.com/kamilsk/click@^1.0.0 -- make test install

Mirror

$ egg bitbucket.org/kamilsk/click@^1.0.0 -- make test install

egg is an extended go get.

Update

This application is in a state of MVP and under active development. SemVer is used for releases, and you can easily be updated within minor versions, but major versions can be not BC-safe.

Notes


Gitter @kamilsk @octolab

made with ❤️ by OctoLab