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:
nutcas3
2026-04-17 16:32:00 +03:00
parent 978918f956
commit d4ee90de45
+5
View File
@@ -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)