Skip to content
Go client for gitignore.io
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/gogi
.gitignore Initial commit Jun 22, 2016
.travis.yml udpate to go1.13 Sep 3, 2019
CHANGELOG.md Update changelog Dec 20, 2018
Dockerfile.build Gnouc -> cuonglm Apr 3, 2019
Dockerfile.run Adding Dockerfiles for building images Jul 24, 2016
LICENSE Initial commit Jun 22, 2016
README.md Gnouc -> cuonglm Apr 3, 2019
go.mod udpate to go1.13 Sep 3, 2019
gogi.go make API more friendly Dec 20, 2018
gogi_test.go
methods.go make API more friendly Dec 20, 2018
methods_test.go make API more friendly Dec 20, 2018

README.md

gogi - Go client for gitignore.io

Build Status Go Report Card GoDoc

Why gogi?

Make gitignore client more portable, without relying on the shell, curl, wget or any other http client.

Installation

go get -u github.com/cuonglm/gogi

Usage

As library

import (
	"fmt"
	"log"

	"github.com/cuonglm/gogi"
)

func main() {
	gogiClient, _ := gogi.NewHTTPClient()
	data, err := gogiClient.List()
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(data)
}

As binary:

$ go get github.com/cuonglm/gogi/cmd/gogi
$ gogi
Usage of gogi:
  -create string
    	Create .gitignore content for given types
  -list
    	List all defined types
  -search string
    	Show all types match string

Using docker

Using gnouc/gogi image

$ docker pull gnouc/gogi
$ docker run --rm gnouc/gogi -search python
ipythonnotebook
python

Building your own image

Building builder image

docker build -t gogi-builder -f Dockerfile.build .

Building binary image

docker run --rm gogi-builder | docker build -t gogi -f Dockerfile.run -

Environment variables

GOGI_API_URL to change your gitignore server, default to https://www.gitignore.io

Author

Cuong Manh Le cuong.manhle.vn@gmail.com

License

See LICENSE

You can’t perform that action at this time.