mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
feat: Add BaseURL method to API client for exposing configured endpoint
- Add BaseURL() method to return configured API endpoint - Add godoc comment describing use case for UI display
This commit is contained in:
@@ -32,6 +32,11 @@ func NewClient(cfg *types.CLIConfig) *Client {
|
||||
}
|
||||
}
|
||||
|
||||
// BaseURL returns the configured API endpoint (useful for UI display).
|
||||
func (c *Client) BaseURL() string {
|
||||
return c.baseURL
|
||||
}
|
||||
|
||||
// doGetJSON performs a GET request and decodes JSON into out
|
||||
func (c *Client) doGetJSON(path string, out any) error {
|
||||
req, err := http.NewRequest("GET", c.baseURL+path, nil)
|
||||
|
||||
Reference in New Issue
Block a user