|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +<!-- Canonical source: AGENTS.md. This file is auto-generated for Claude Code compatibility. --> |
| 4 | + |
| 5 | +This file provides guidance to AI coding assistants when working with this repository. |
| 6 | + |
| 7 | +## Project Overview |
| 8 | + |
| 9 | +OCM SDK for Go — a client library that simplifies interaction with the OpenShift Cluster Manager (OCM) API. Provides type-safe Go bindings generated from the OCM API model, with authentication, pagination, and error handling built in. |
| 10 | + |
| 11 | +## Build & Test Commands |
| 12 | + |
| 13 | +```bash |
| 14 | +make generate # Regenerate SDK code from model definitions |
| 15 | +make fmt # Format Go source code |
| 16 | +make goimports # Organize imports |
| 17 | +make lint # Run golangci-lint |
| 18 | +make examples # Build example programs |
| 19 | +make clean # Remove generated files |
| 20 | +``` |
| 21 | + |
| 22 | +Tests use Ginkgo: |
| 23 | +```bash |
| 24 | +make ginkgo-install # Install Ginkgo test runner |
| 25 | +ginkgo ./... # Run all tests |
| 26 | +``` |
| 27 | + |
| 28 | +## Architecture |
| 29 | + |
| 30 | +The SDK is organized by OCM API service area, each in its own top-level package: |
| 31 | + |
| 32 | +- **clustersmgmt/**: Cluster management API bindings |
| 33 | +- **accountsmgmt/**: Account management API bindings |
| 34 | +- **addonsmgmt/**: Add-on management API bindings |
| 35 | +- **servicelogs/**: Service logs API bindings |
| 36 | +- **authorizations/**: Authorization API bindings |
| 37 | +- **authentication/**: Authentication utilities and token handling |
| 38 | +- **configuration/**: SDK configuration |
| 39 | +- **errors/**: Error type definitions |
| 40 | +- **helpers/**: Shared utility functions |
| 41 | +- **logging/**: Logging interfaces |
| 42 | +- **testing/**: Test utilities and mock transport |
| 43 | +- **examples/**: Usage examples |
| 44 | + |
| 45 | +## Key Conventions |
| 46 | + |
| 47 | +- Module path: `github.com/openshift-online/ocm-sdk-go` |
| 48 | +- Most code is auto-generated from the OCM API model — do not edit generated files directly |
| 49 | +- Uses builder pattern for constructing API requests |
| 50 | +- Ginkgo/Gomega for testing |
| 51 | +- Generated files can be identified by their header comments |
0 commit comments