Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Latest commit

 

History

History
41 lines (30 loc) · 784 Bytes

README.md

File metadata and controls

41 lines (30 loc) · 784 Bytes

This repository is archived, please go to https://github.com/G-PORTAL/gpcloud-go for the latest version.


GPCloud Golang Client

This is the official GPCloud Golang client. Please raise an issue if you have found any problems or having questions.

Recommendations

  • Golang 1.16 or higher

Example usage

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/GPORTALcloud/gpcloud-go/pkg/gpcloud/client"
	"github.com/GPORTALcloud/gpcloud-go/pkg/gpcloud/ptypes"
)

func main() {
	cl, err := client.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	keys, err := cl.PublicClient().ListJwtPublicKeys(context.Background(), &ptypes.EmptyRequest{})
	if err != nil {
		log.Fatal(err)
	}

	for _, key := range keys.GetKeys() {
		fmt.Println(key.Kid)
	}
}