go-pastel
Golang fork of https://github.com/bobpp/pastel, which is a copy and paste sharing web app.
Description
go-pastel is a copy and paste sharing web application like gist written in golang.
Installation
Executable binaries, which contains asset files, are available at releases.
For example, for linux x86_64,
$ version=0.1.0
$ wget https://github.com/sonots/go-pastel/releases/download/$version/go-pastel_linux_amd64 -O go-pastel
$ chmod a+x go-pastel
If you have the go runtime installed, you may use go get.
$ go get github.com/sonots/go-pastel
Usage
$ go-pastel -h
NAME:
go-pastel - A copy and paste sharing web application like git
USAGE:
go-pastel [global options] command [command options] [arguments...]
COMMANDS:
start, s Start up
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--host '0.0.0.0' Address to serve this service
--port '5050' Port number to serve this service
--database_url 'pastel.db' Path to sqlite storage file
--help, -h show help
--version, -v print the version
Build
To build, use go get and make
$ go get -d github.com/sonots/go-pastel
$ cd $GOPATH/src/github.com/sonots/go-pastel
$ make
$ go run main.go version.go bindata.go # run
To release binaries, I use gox and ghr
go get github.com/mitchellh/gox
gox -build-toolchain # only first time
go get github.com/tcnksm/ghr
mkdir -p pkg && cd pkg && gox --os=linux --os=windows ../...
ghr <tag> .
ToDo
- write tests
- output log to file, allow to change log_level
- How to limit number of concurrent http requests?
- How to limit number of concurrent db connections? => db.SetMaxIdleConns
Contribution
- Fork (https://github.com/sonots/go-pastel/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the go test ./... command and confirm that it passes
- Run gofmt -s
- Create new Pull Request
Copyright
See LICENSE