PipeOps Go SDK

A comprehensive Go SDK for interacting with the PipeOps Control Plane API.
Features
- Complete API Coverage: All API endpoints covered across 18 service modules
- Type-Safe: Strongly typed request/response structures
- Context Support: All methods support context for cancellation and timeouts
- OAuth 2.0: Full OAuth 2.0 authorization code flow support
- Flexible: Custom HTTP client support
- Well-Documented: Comprehensive examples and documentation
Installation
go get github.com/PipeOpsHQ/pipeops-go-sdk
Usage
package main
import (
"context"
"fmt"
"log"
"github.com/PipeOpsHQ/pipeops-go-sdk/pipeops"
)
func main() {
// Create a new client
client := pipeops.NewClient("https://api.pipeops.io")
// Login to get an authentication token
ctx := context.Background()
loginReq := &pipeops.LoginRequest{
Email: "your-email@example.com",
Password: "your-password",
}
resp, _, err := client.Auth.Login(ctx, loginReq)
if err != nil {
log.Fatal(err)
}
// Set the token for authenticated requests
client.SetToken(resp.Data.Token)
// Now you can make authenticated API calls
projects, _, _ := client.Projects.List(ctx, nil)
fmt.Printf("Found %d projects\n", len(projects.Data.Projects))
}
OAuth 2.0 Support
The SDK includes full support for OAuth 2.0 authorization code flow:
// Generate authorization URL
authURL, _ := client.OAuth.Authorize(&pipeops.AuthorizeOptions{
ClientID: "your-client-id",
RedirectURI: "http://localhost:3000/callback",
ResponseType: "code",
Scope: "user:read user:write",
State: "random-state",
})
// Exchange code for token
token, _, _ := client.OAuth.ExchangeCodeForToken(ctx, &pipeops.TokenRequest{
GrantType: "authorization_code",
Code: authCode,
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
})
client.SetToken(token.AccessToken)
// Get user info
userInfo, _, _ := client.OAuth.GetUserInfo(ctx)
See examples/oauth/ for a complete OAuth flow example.
Documentation
For detailed API documentation, please refer to:
Examples
License
This SDK is distributed under the terms of the license specified in the LICENSE file.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
See CONTRIBUTING.md for guidelines.
Release Process
See RELEASE.md for information about creating releases and publishing the SDK.