zerops-go

module
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT

README

Installation

go get -u github.com/zeropsio/zerops-go

Basic example

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"

	"github.com/zeropsio/zerops-go/sdk"
	"github.com/zeropsio/zerops-go/sdkBase"
)

func main() {
	ctx := context.Background()

	zdk := sdk.New(
		sdkBase.DefaultConfig(),
		http.DefaultClient,
	)

	authorizedSdk := sdk.AuthorizeSdk(zdk, os.Getenv("token"))

	info, err := authorizedSdk.GetUserInfo(ctx)
	if err != nil {
		panic(err)
	}

	i, err := info.Output()
	if err != nil {
		panic(err)
	}

	clientId := i.ClientUserList[0].ClientId
	fmt.Println(clientId)
}

Jump to

Keyboard shortcuts

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