modulepackage
0.0.0-20241029085104-d3fedb186c73
Repository: https://github.com/rigdev/rig-go-sdk.git
Documentation: pkg.go.dev
# README
Rig Golang SDK
Overview
Rig provides the tools, modules and infrastructure you need to develop and manage applications on Kubernetes. The Rig Golang SDK enables access to Rig services from privileged environments (such as servers or cloud) in Golang.
For more information, visit the Rig Golang SDK setup guide.
Installation
The Rig Golang SDK can be installed using the go install utility:
# Install the latest version:
go get github.com/rigdev/rig-go-sdk@latest
# Or install a specific version:
go get github.com/rigdev/[email protected]
Setup the Client
To setup the client use the rig.NewClient
method:
package main
import (
"context"
"fmt"
"log"
"connectrpc.com/connect"
rig "github.com/rigdev/rig-go-sdk"
"github.com/rigdev/rig-go-api/api/v1/user"
)
func main() {
client := rig.NewClient()
// you can now make requests to Rig
if _, err := client.User().Create(context.Background(), connect.NewRequest(&user.CreateRequest{
Initializers: []*user.Update{},
})); err != nil {
log.Fatal(err)
}
fmt.Println("success")
}
Host
By default, the SDK will connect to http://localhost:4747
. To change this, use the rig.WithHost(...)
option:
client := rig.NewClient(rig.WithHost("my-rig:4747"))
Credentials
By default, the SDK will use the environment variables RIG_CLIENT_ID
and RIG_CLIENT_SECRET
to read the credentials. To explicitly set the credentials, use rig.WithClientCredentials(...)
option:
client := rig.NewClient(rig.WithClientCredentials(rig.ClientCredential{
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
}))
Documentation
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
ClientCredential to use for authenticating with the backend using the OAuth2 Client Credentials flow.
No description provided by the author
# Interfaces
Client for interacting with the Rig APIs.
No description provided by the author
SessionManager is used by the Client to help maintain the access and refresh tokens.
# Type aliases
No description provided by the author