https://github.com/kochie/zeit-api-go
An API for Zeit written for Go
https://github.com/kochie/zeit-api-go
golang gomock now zeit
Last synced: 6 months ago
JSON representation
An API for Zeit written for Go
- Host: GitHub
- URL: https://github.com/kochie/zeit-api-go
- Owner: kochie
- License: mit
- Created: 2019-05-09T03:38:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-05T16:42:39.000Z (over 6 years ago)
- Last Synced: 2024-06-19T23:14:13.030Z (about 2 years ago)
- Topics: golang, gomock, now, zeit
- Language: Go
- Size: 61.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ZEIT API
[](https://travis-ci.com/kochie/zeit-api-go)
[](https://godoc.org/github.com/kochie/zeit-api-go)
[](https://coveralls.io/github/kochie/zeit-api-go?branch=master)
[](https://goreportcard.com/report/github.com/kochie/zeit-api-go)
```bash
go get github.com/kochie/zeit-api-go
```
## Example
```go
package main
import (
"fmt"
"github.com/kochie/zeit-api-go"
)
func main(){
token := "secret token"
zeitClient := zeit.NewClient(token)
zeitClient.Team("team name") // Team name can be optionally set
domains, err := zeitClient.GetAllDomains()
if err != nil {
fmt.Println(err.Error())
}
for _, domain := range domains {
fmt.Println(domain)
}
}
```
## Testing
Each method should have sufficient test coverage and an integration test. To facillitate the development of tests there is a mocking interface set up which can be used. Mocks can be created using the `go generate` command or by using the `mockgen` command.
```bash
# Example mocking of HttpClient
mockgen -destination=mocks/mock_http_client.go -package=mocks github.com/kochie/zeit-api-go HttpClient
```
Integration tests will not run unless the `integration` flag is set.
```bash
go test -tags integration
```
More information about setting up a development environment can be found in the [contribution guide](./CONTRIBUTING.md).
## APIs
As listed in the [API documentation](https://zeit.co/docs/api)
Currently supported endpoints are.
- [x] Domains
- [x] DNS
- [ ] OAuth2
- [ ] Authentication
- [ ] Deployments
- [ ] Logs
- [ ] Certificates
- [ ] Aliases
- [ ] Secrets
- [ ] Teams
- [ ] Projects