All Projects → netlify → go-client

netlify / go-client

Licence: MIT license
Depreciated repo: home of the old go client. See netlify/open-api for the new home of the go client

Programming Languages

go
31211 projects - #10 most used programming language

BitBallon API Client in Go

See the netlify package on godoc for full library documentation.

Quick Start

First go get github.com/netlify/netlify-go then use in your go project.

import "github.com/netlify/netlify-go"

client := netlify.NewClient(&netlify.Config{AccessToken: AccessToken})

// Create a new site
site, resp, err := client.Sites.Create(&SiteAttributes{
  Name: "site-subdomain",
  CustomDomain: "www.example.com",
  Password: "secret",
  NotificationEmail: "[email protected]",
})

// Deploy a directory
deploy, resp, err := site.Deploys.Create("/path/to/directory")

// Wait for the deploy to process
err := deploy.WaitForReady(0)

// Get a single site
site, resp, err := client.Sites.Get("my-site-id")

// Set the domain of the site
site.CustomDomain = "www.example.com"

// Update the site
resp, err := site.Update()

// Deploy a new version of the site from a zip file
deploy, resp, err := site.Deploys.Create("/path/to/file.zip")
deploy.WaitForReady(0)

// Delete the site
resp, err := site.Destroy()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].