mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-15 08:25:12 +00:00
docs: Add Go SDK README with comprehensive API documentation and implement modular architecture with authentication provider
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Add AuthProvider class with API key and JWT token support (GenerateJWTToken, ValidateJWTToken, GetHeaders, ClearTokenCache methods) - Add HTTPClient base class with retry logic, error handling, and timeout management - Add GraphQLAPI, PaymentsAPI, RatingPlansAPI
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package telecom
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// SystemAPI handles system-related API calls
|
||||
type SystemAPI struct {
|
||||
client *HTTPClient
|
||||
}
|
||||
|
||||
// NewSystemAPI creates a new SystemAPI
|
||||
func NewSystemAPI(client *HTTPClient) *SystemAPI {
|
||||
return &SystemAPI{client: client}
|
||||
}
|
||||
|
||||
// GetStats retrieves system statistics
|
||||
func (s *SystemAPI) GetStats(ctx context.Context) (*SystemStats, error) {
|
||||
var stats SystemStats
|
||||
err := s.client.Get(ctx, "/v1/system/stats", &stats)
|
||||
return &stats, err
|
||||
}
|
||||
|
||||
// GetHealth retrieves system health status
|
||||
func (s *SystemAPI) GetHealth(ctx context.Context) (*HealthStatus, error) {
|
||||
var health HealthStatus
|
||||
err := s.client.Get(ctx, "/v1/health", &health)
|
||||
return &health, err
|
||||
}
|
||||
Reference in New Issue
Block a user