go

module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0

README

Go Asgardeo SDK

Typed Go client SDK for the Asgardeo Management API, enabling easy integration with Asgardeo services.

Requirements

  • Go 1.22 or later

Installation

Use go get to install the SDK:

go get github.com/asgardeo/go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "time"

    "github.com/asgardeo/go/pkg/config"
    "github.com/asgardeo/go/pkg/sdk"
)

func main() {
    // Configure the client with client credentials grant
    cfg := config.DefaultClientConfig().
        WithBaseURL("https://api.asgardeo.io/t/<tenant-domain>").
        WithTimeout(10 * time.Second).
        WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        )

    // Initialize the SDK client
    client, err := sdk.New(cfg)
    if err != nil {
        log.Fatalf("failed to initialize SDK client: %v", err)
    }

    // List applications
    ctx := context.Background()
    resp, err := client.Application.List(ctx, 10, 0)
    if err != nil {
        log.Fatalf("failed to list applications: %v", err)
    }

    fmt.Printf("Total applications: %d\n", *resp.TotalResults)
    for _, app := range *resp.Applications {
        fmt.Printf("- %s (ID: %s)\n", *app.Name, *app.Id)
    }
}

Examples

A runnable example is available in the examples/application directory:

go run examples/application/main.go

Services

  • Applications

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open a pull request or an issue to get started.

Directories

Path Synopsis
examples
api-resource command
application command
authenticator command
claim command
pkg
api_resource
Package api_resource provides primitives to interact with the openapi HTTP API.
Package api_resource provides primitives to interact with the openapi HTTP API.
application
Package application provides primitives to interact with the openapi HTTP API.
Package application provides primitives to interact with the openapi HTTP API.
authenticator
Package authenticator provides primitives to interact with the openapi HTTP API.
Package authenticator provides primitives to interact with the openapi HTTP API.
claim
Package claim provides primitives to interact with the openapi HTTP API.
Package claim provides primitives to interact with the openapi HTTP API.
identity_provider
Package identity_provider provides primitives to interact with the openapi HTTP API.
Package identity_provider provides primitives to interact with the openapi HTTP API.
sdk

Jump to

Keyboard shortcuts

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