Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyAuth ¶
type APIKeyAuth struct {
// contains filtered or unexported fields
}
APIKeyAuth adds an API key as a header or query param from an env var.
func NewAPIKeyAuth ¶
func NewAPIKeyAuth(keyEnv, in, name string) *APIKeyAuth
type Authenticator ¶
Authenticator injects auth into outbound HTTP requests.
func NewAuthenticator ¶
func NewAuthenticator(authType, tokenEnv, keyEnv, keyName, keyIn string) Authenticator
NewAuthenticator creates the right authenticator from CLI flags.
type BearerAuth ¶
type BearerAuth struct {
// contains filtered or unexported fields
}
BearerAuth adds Authorization: Bearer from an env var.
func NewBearerAuth ¶
func NewBearerAuth(tokenEnv string) *BearerAuth
type HTTPExecutor ¶
type HTTPExecutor struct {
// contains filtered or unexported fields
}
HTTPExecutor implements RequestExecutor using net/http.
func New ¶
func New(client *http.Client, auth Authenticator, timeout time.Duration) *HTTPExecutor
New creates an HTTPExecutor.
func (*HTTPExecutor) Execute ¶
func (e *HTTPExecutor) Execute(ctx context.Context, req *ToolRequest) (*ToolResponse, error)
Execute runs the tool request against the upstream API.
type RequestExecutor ¶
type RequestExecutor interface {
Execute(ctx context.Context, req *ToolRequest) (*ToolResponse, error)
}
RequestExecutor makes HTTP calls for tool invocations.
type ToolRequest ¶
type ToolRequest struct {
ServerURL string
Path string
Method string
Args map[string]any
ParamMeta []toolgen.ParamMeta
}
ToolRequest holds the data needed to call an upstream API.
type ToolResponse ¶
ToolResponse holds the upstream API response.
Click to show internal directories.
Click to hide internal directories.