If you don't have a project yet and you're just trying to experiment with the package, you can create a new directory, initialize a new Go module there, and then try to fetch the dependency:
mkdir myproject
cd myproject
go mod init myproject
go get github.com/deploymenttheory/go-jamfpro-api@latest
to add module requirements and sums:
go mod tidy
package main
import (
"fmt"
"log"
jamf "github.com/deploymenttheory/go-jamfpro-api"
)
func main() {
// Credentials and URL for Jamf API
username := "your-jamf-api-account"
password := "your-jamf-api-account-password"
url := "your-jamf-instance" // e.g., "yourcompany.jamfcloud.com"
// Set up the configuration for the Jamf Pro API client
cfg := jamf.Config{
AuthMethod: jamf.BasicAuthConfig{
Username: username,
Password: password,
},
URL: url,
HTTPClient: &http.Client{},
HttpRetryTimeout: 30 * time.Second, // Optional, defaults to 10 seconds if not defined
}
}