{"modulePath":"github.com/GoCodeAlone/workflow-plugin-data-engineering","version":"v0.3.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpclient\n\nPackage httpclient provides a shared HTTP client for REST API integrations.\n\n## Types\n\n```go\ntype AuthConfig struct {\n\t// Type is the auth type: \"bearer\", \"basic\", or \"none\".\n\tType     string\n\tToken    string\n\tUsername string\n\tPassword string\n}\n```\nAuthConfig holds authentication configuration for HTTP requests.\n\n```go\ntype Client struct {\n\tBaseURL    string\n\tHTTPClient *http.Client\n\tAuth       AuthConfig\n}\n```\nClient is a reusable HTTP client with a fixed base URL and auth configuration.\n\n```go\nfunc New(baseURL string, auth AuthConfig, timeout time.Duration) *Client\n```\nNew creates a Client with the given base URL, auth config, and timeout.\n\n```go\nfunc (c *Client) Do(ctx context.Context, method, path string, body any) (*http.Response, error)\n```\nDo builds and executes an HTTP request. When body is non-nil it is marshaled to JSON and Content-Type is set to application/json. The caller is responsible for reading and closing the response body.\n\n```go\nfunc (c *Client) DoJSON(ctx context.Context, method, path string, body any, out any) error\n```\nDoJSON calls Do and reads the response, unmarshaling a successful body into out. If out is nil the response body is discarded. Returns an error for HTTP status \u003e= 400.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-data-engineering/internal/httpclient","name":"httpclient","synopsis":"Package httpclient provides a shared HTTP client for REST API integrations.","isRedistributable":true}
