instruqt-go
is a Go client library for interacting with the Instruqt platform. It provides a simple and convenient way to programmatically access Instruqt's APIs, manage content, retrieve user data and track information.
- Manage Instruqt Teams and Challenges: Retrieve team information, challenges, and user progress.
To install the instruqt-go
library, run:
go get github.com/isovalent/instruqt-go
package main
import (
"github.com/isovalent/instruqt-go/instruqt"
"cloud.google.com/go/logging"
)
func main() {
// Initialize the Instruqt client
client := instruqt.NewClient("your-api-token", "your-team-slug")
// Get all tracks
tracks, err := client.GetTracks()
// Add context to calls
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
clientWithTimeout := client.WithContext(ctx)
userInfo, err := clientWithTimeout.GetUserInfo("user-id")
// Attach a logger
logClient, err := logging.NewClient(ctx, "some-gcp-project")
if err != nil {
panic("failed to create log client")
}
stdLogger := logClient.Logger("my-std-logger")
client.InfoLogger = stdLogger.StandardLogger(logging.Info)
}
We welcome contributions! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch with your feature or bug fix.
- Make your changes and add tests.
- Submit a pull request with a detailed description of your changes.
To run the tests, use:
go test ./...
Make sure to write tests for any new functionality and ensure that all existing tests pass.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you have any questions or need help, feel free to open an issue in the GitHub repository.
- Instruqt for their amazing platform.