Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cuonglm/gogi
Go client for gitignore.io
https://github.com/cuonglm/gogi
git gitignore go gogi golang golang-library golang-tools
Last synced: 10 days ago
JSON representation
Go client for gitignore.io
- Host: GitHub
- URL: https://github.com/cuonglm/gogi
- Owner: cuonglm
- License: other
- Created: 2016-06-22T09:22:32.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2021-08-14T17:57:57.000Z (about 3 years ago)
- Last Synced: 2024-10-19T05:57:04.667Z (19 days ago)
- Topics: git, gitignore, go, gogi, golang, golang-library, golang-tools
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 60
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gogi - Go client for gitignore.io
![Build Status](https://github.com/cuonglm/gogi/actions/workflows/ci.yml/badge.svg?branch=main)
[![Go Reference](https://pkg.go.dev/badge/github.com/cuonglm/gogi.svg)](https://pkg.go.dev/github.com/cuonglm/gogi)
[![Go Report Card](https://goreportcard.com/badge/github.com/cuonglm/gogi)](https://goreportcard.com/report/github.com/cuonglm/gogi)# Why gogi?
Make gitignore client more portable, without relying on the shell, curl, wget or any other http client.
# Installation
```sh
go get -u github.com/cuonglm/gogi
```# Usage
## As library
```go
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:
```sh
$ 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
```sh
$ docker pull gnouc/gogi
$ docker run --rm gnouc/gogi -search python
ipythonnotebook
python
```### Building your own image
Building builder image
```sh
docker build -t gogi-builder -f Dockerfile.build .
```Building binary image
```sh
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
# License
See [LICENSE](https://github.com/cuonglm/gogi/blob/main/LICENSE)