Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.89 KB

README.md

File metadata and controls

65 lines (53 loc) · 1.89 KB

ZEIT API

Build Status GoDoc Coverage Status Go Report Card

go get github.com/kochie/zeit-api-go

Example

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.

# 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.

go test -tags integration

More information about setting up a development environment can be found in the contribution guide.

APIs

As listed in the API documentation

Currently supported endpoints are.

  • Domains
  • DNS
  • OAuth2
  • Authentication
  • Deployments
  • Logs
  • Certificates
  • Aliases
  • Secrets
  • Teams
  • Projects