Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type AuthType
Token string // For bearer tokens
APIKey string // For API keys
APIKeyIn string // header, query, cookie
KeyName string // Name of the header/query param
Username string // For basic auth
Password string // For basic auth
}
AuthConfig holds authentication configuration
type AuthManager ¶
type AuthManager struct {
// contains filtered or unexported fields
}
AuthManager manages authentication for API requests
func NewAuthManager ¶
func NewAuthManager(spec *Spec) *AuthManager
NewAuthManager creates a new auth manager
func (*AuthManager) ApplyAuth ¶
func (am *AuthManager) ApplyAuth(req *http.Request) error
ApplyAuth applies authentication to an HTTP request
func (*AuthManager) GetAuth ¶
func (am *AuthManager) GetAuth() *AuthConfig
GetAuth returns current auth config
func (*AuthManager) GetAvailableAuthSchemes ¶
func (am *AuthManager) GetAvailableAuthSchemes() []string
GetAvailableAuthSchemes returns available auth schemes from the spec
func (*AuthManager) ParseAuthScheme ¶
func (am *AuthManager) ParseAuthScheme(schemeName string) (*AuthConfig, error)
ParseAuthScheme parses an auth scheme from the OpenAPI spec
func (*AuthManager) SetAuth ¶
func (am *AuthManager) SetAuth(config *AuthConfig)
SetAuth configures authentication
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles HTTP requests to the API
func NewClient ¶
func NewClient(baseURL string, authMgr *AuthManager) *Client
NewClient creates a new API client
type Endpoint ¶
type Endpoint struct {
Path string
Method string
Summary string
Description string
Tags []string
Parameters []Parameter
RequestBody string
HasBody bool
}
Endpoint represents an API endpoint
type Parameter ¶
type Parameter struct {
Name string
In string // path, query, header, cookie
Required bool
Description string
Schema string
Example string
}
Parameter represents a request parameter
type Request ¶
type Request struct {
Method string
Path string
Headers map[string]string
QueryParams map[string]string
Body string
ContentType string
}
Request represents an API request
type Response ¶
type Response struct {
StatusCode int
Status string
Headers http.Header
Body string
Duration time.Duration
Error error
}
Response represents an API response
func (*Response) FormatResponseBody ¶
FormatResponseBody formats the response body for display
type Spec ¶
Spec wraps an OpenAPI specification with metadata
func (*Spec) GetEndpoints ¶
GetEndpoints extracts all endpoints from the spec