|
1 |
| -# digdag-go-client |
| 1 | +# digdag-go-client |
| 2 | + |
| 3 | +[](https://codecov.io/gh/szyn/digdag-go-client) |
| 4 | +[](https://godoc.org/github.com/szyn/digdag-go-client) |
| 5 | + |
| 6 | +## Description |
| 7 | + |
| 8 | +Digdag client library written in Go. (Unofficial) |
| 9 | + |
| 10 | +## Requirement |
| 11 | + |
| 12 | +* digdag server |
| 13 | + |
| 14 | +## Install |
| 15 | + |
| 16 | +```console |
| 17 | +$ go get -u github.com/szyn/digdag-go-client |
| 18 | +``` |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +### e.g. Get projects infomation |
| 23 | + |
| 24 | +```go |
| 25 | +package main |
| 26 | + |
| 27 | +import ( |
| 28 | + "fmt" |
| 29 | + |
| 30 | + digdag "github.com/szyn/digdag-go-client" |
| 31 | +) |
| 32 | + |
| 33 | +func main() { |
| 34 | + /* |
| 35 | + default endpoint: http://localhost:65432 |
| 36 | + If you want to change endpoint, write as the following. |
| 37 | + client, err := digdag.NewClient("http://hostname:5432", false) |
| 38 | + */ |
| 39 | + client, err := digdag.NewClient("", false) |
| 40 | + if err != nil { |
| 41 | + fmt.Println(err) |
| 42 | + } |
| 43 | + |
| 44 | + projects, err := client.GetProjects() |
| 45 | + if err != nil { |
| 46 | + fmt.Println(err) |
| 47 | + } |
| 48 | + for _, project := range projects { |
| 49 | + fmt.Println(project.ID, project.Name) |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +``` |
| 54 | + |
| 55 | +See also: [Godoc](https://godoc.org/github.com/szyn/digdag-go-client) |
| 56 | + |
| 57 | +## Contribution |
| 58 | + |
| 59 | +1. Fork it ( http://github.com/szyn/digdag-go-client ) |
| 60 | +1. Create your feature branch ( `git checkout -b my-new-feature` ) |
| 61 | +1. Commit your changes ( `git commit -am 'Add some feature'` ) |
| 62 | +1. Push to the branch ( `git push origin my-new-feature` ) |
| 63 | +1. Run test suite ( `go test ./...` ) and confirm that it passes |
| 64 | +1. Run gofmt ( `gofmt -s` ) |
| 65 | +1. Create new Pull Request 😆 |
| 66 | + |
| 67 | +## LICENCE |
| 68 | + |
| 69 | +[Apache License 2.0](LICENSE) |
| 70 | + |
| 71 | +## Author |
| 72 | + |
| 73 | +[szyn](https://github.com/szyn) |
0 commit comments