go-webflow

module
v0.0.0-...-801cc09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2021 License: MIT

README

go-webflow

A Webflow API client enabling Go programs to interact with Webflow in a simple and uniform way.

Inspired by go-github.

Test Status GoDoc Go Report Card

Supported APIs

TODOs
  • [] Test

Usage

import "github.com/aesadde/go-webflow/webflow"

Then construct a new client providing your Webflow API Key and use the client to interact with the different parts of the API.

For example you can use the sites and domains APIs to publish a site

    client := webflow.NewClient("YOUR_API_KEY")

    siteId := "YOUR_SITE_ID"

    site, err := client.Sites.GetSite(context.Background(), siteId)
    if err != nil {
        return
    }

    domains, err := client.Domains.ListDomains(context.Background(), site.Id, nil)
    if err != nil {
        return
    }

    toPublish := make([]string, len(domains))
    for i, d := range domains {
        toPublish[i] = d.Name
    }

    published, err := client.Sites.PublishSite(context.Background(), siteId, toPublish)
    if err != nil {
        return
    }
    fmt.Println(published)

Examples

A full list of examples can be found in the examples folder.

Issues

If you have an issue: report it on the issue tracker.

Author

Alberto Sadde (@aesadde).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL