Skip to content

flowswiss/goclient

Repository files navigation

GoClient

This is the official API client, written in Go, for accessing the Flow Swiss and Cloudbit APIs. Our API Documentation can be found at my.flow.swiss/#/doc or my.cloudbit.ch/#/doc.

Installation

go get github.com/flowswiss/goclient

Example

package main

import (
  "context"
  "fmt"

  "github.com/flowswiss/goclient"
  "github.com/flowswiss/goclient/compute"
)

func main() {
  client := goclient.NewClient(goclient.WithToken("your-application-token"))
  
  service := compute.NewServerService(client)

  res, err := service.List(context.Background(), goclient.Cursor{
    Page:    1,
    PerPage: 5,
  })

  if err != nil {
    fmt.Println("error listing servers: ", err)
  }

  for _, server := range res.Items {
    fmt.Println("found server with id ", server.Id)
  }
}

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages