Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 545 Bytes

README.md

File metadata and controls

38 lines (30 loc) · 545 Bytes

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)
	}
}