cgroschupp / go-client-confluent-cloud

MIT License
13 stars 19 forks source link

go-client-confluent-cloud

package main

import (
    "fmt"
    "log"

    "github.com/cgroschupp/go-client-confluent-cloud/confluentcloud"
)

func main() {
    client := confluentcloud.NewClient("<EMAIL>", "<PASSWORD>")
    err := client.Login()
    if err != nil {
        log.Print(err)
        return
    }

    userData, err := client.Me()
    if err != nil {
        log.Print(err)
        return
    }

    clusters, err := client.ListClusters(userData.Account.ID)
    if err != nil {
        log.Print(err)
        return
    }

    for _, cluster := range clusters {
        fmt.Println(cluster.ID)
    }
}