Documentation
¶
Overview ¶
Package tool provides browser automation capabilities via HTTP.
Index ¶
- func ValidateURL(rawURL string) (*url.URL, error)
- type BrowserOptions
- type BrowserTool
- func (b *BrowserTool) Do(ctx context.Context, method, urlStr string, body io.Reader) (*Response, error)
- func (b *BrowserTool) Get(ctx context.Context, urlStr string) (*Response, error)
- func (b *BrowserTool) Post(ctx context.Context, urlStr string, body io.Reader) (*Response, error)
- func (b *BrowserTool) SetHeader(key, value string)
- type Formatter
- type Response
- type WebhookTester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BrowserOptions ¶
type BrowserOptions struct {
Timeout time.Duration
Follow bool
MaxRedirects int
Headers map[string]string
}
BrowserOptions configures browser behavior.
func DefaultBrowserOptions ¶
func DefaultBrowserOptions() BrowserOptions
DefaultBrowserOptions returns default browser options.
type BrowserTool ¶
type BrowserTool struct {
// contains filtered or unexported fields
}
BrowserTool provides browser automation capabilities via HTTP.
func NewBrowserTool ¶
func NewBrowserTool(opts ...func(*BrowserOptions)) *BrowserTool
NewBrowserTool creates a new browser tool.
func (*BrowserTool) Do ¶
func (b *BrowserTool) Do(ctx context.Context, method, urlStr string, body io.Reader) (*Response, error)
Do performs an HTTP request.
func (*BrowserTool) SetHeader ¶
func (b *BrowserTool) SetHeader(key, value string)
SetHeader sets a default header.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter provides formatted output for browser tool results.
func (*Formatter) FormatResponse ¶
FormatResponse formats a response.
type Response ¶
type Response struct {
StatusCode int
Headers http.Header
Body []byte
URL string
RequestMethod string
}
Response represents an HTTP response.
type WebhookTester ¶
type WebhookTester struct {
// contains filtered or unexported fields
}
WebhookTester tests webhooks by sending test requests.
func NewWebhookTester ¶
func NewWebhookTester(opts ...func(*BrowserOptions)) *WebhookTester
NewWebhookTester creates a new webhook tester.
func (*WebhookTester) SendTestRequest ¶
func (w *WebhookTester) SendTestRequest(ctx context.Context, webhookURL string, payload interface{}) (*Response, error)
SendTestRequest sends a test request to a webhook URL.
func (*WebhookTester) ValidateWebhook ¶
func (w *WebhookTester) ValidateWebhook(ctx context.Context, webhookURL string, expectedStatus int) error
ValidateWebhook validates a webhook endpoint.