feat: initialize client core and ping endpoint

establishes the foundational architecture for the Onspring Go SDK.

changes included:
- add `Client` struct and `NewClient` constructor with authentication.
- implement functional options pattern (WithHTTPClient, WithBaseURL, etc.).
- add `OnspringAPIError` type for handling non-2xx responses.
- implement internal request construction and execution logic.
- add `Ping` service for API health check verification.
- add comprehensive unit tests and mock server infrastructure.
This commit is contained in:
Stevan Freeborn
2025-12-05 21:33:23 -06:00
parent 3098779596
commit a9e49906e0
10 changed files with 568 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package onspring
import "net/http"
func (c *Client) HTTPClient() *http.Client {
return c.httpClient
}
func (c *Client) BaseURL() string {
return c.baseURL
}
func (c *Client) APIKey() string {
return c.apiKey
}
func (c *Client) APIVersion() string {
return c.apiVersion
}