Documentation
¶
Index ¶
- Constants
- func AddRoute(paths appconfig.Paths, route Route) (Route, bool, []Route, error)
- func OpenClawConfigPath() string
- func RemoveRoute(paths appconfig.Paths, route Route) (Route, bool, []Route, error)
- func ResolveHookToken(paths appconfig.Paths, probe OpenClawConfigProbe) (string, string)
- func RoutesPath(paths appconfig.Paths) string
- func ValidateHookURL(rawURL string) error
- func WriteRoutes(paths appconfig.Paths, routes []Route) error
- type EffectiveSettings
- type GatewayProbe
- type HookPathProbe
- type HookRequest
- type HookResponse
- type OpenClawConfigProbe
- type Registry
- type Route
- type WebhookClient
Constants ¶
View Source
const ( HookTokenEnv = "OPENCLAW_HOOK_TOKEN" GatewayPortEnv = "OPENCLAW_GATEWAY_PORT" ConfigPathEnv = "OPENCLAW_CONFIG_PATH" DefaultGatewayPort = 18789 DefaultHooksPath = "/hooks" FixedHookName = "AWiki" )
Variables ¶
This section is empty.
Functions ¶
func OpenClawConfigPath ¶
func OpenClawConfigPath() string
func RemoveRoute ¶
func ResolveHookToken ¶
func ResolveHookToken(paths appconfig.Paths, probe OpenClawConfigProbe) (string, string)
func RoutesPath ¶
func ValidateHookURL ¶
Types ¶
type EffectiveSettings ¶
type EffectiveSettings struct {
HookURL string `json:"hook_url"`
HookURLSource string `json:"hook_url_source"`
DetectedWebhookPort int `json:"detected_webhook_port"`
DetectedWebhookPortInfo GatewayProbe `json:"-"`
DetectedWebhookPath string `json:"detected_webhook_path"`
DetectedWebhookPathInfo HookPathProbe `json:"-"`
Token string `json:"-"`
TokenConfigured bool `json:"token_configured"`
TokenSource string `json:"token_source"`
}
func ResolveSettings ¶
func ResolveSettings(resolved *appconfig.Resolved) (EffectiveSettings, error)
type GatewayProbe ¶
type GatewayProbe struct {
Port int `json:"port"`
Source string `json:"source"`
ConfigPath string `json:"config_path,omitempty"`
}
func ProbeGatewayPort ¶
func ProbeGatewayPort(defaultPort int) GatewayProbe
type HookPathProbe ¶
type HookRequest ¶
type HookResponse ¶
type HookResponse struct {
RunID string `json:"run_id"`
}
type OpenClawConfigProbe ¶
type OpenClawConfigProbe struct {
ConfigPath string
Gateway GatewayProbe
HooksPath HookPathProbe
HookToken string
}
func ProbeOpenClawConfig ¶
func ProbeOpenClawConfig(defaultPort int, defaultHooksPath string) OpenClawConfigProbe
type WebhookClient ¶
type WebhookClient struct {
// contains filtered or unexported fields
}
func NewWebhookClient ¶
func NewWebhookClient(hookURL string, token string) (*WebhookClient, error)
func (*WebhookClient) Send ¶
func (c *WebhookClient) Send(ctx context.Context, req HookRequest) (HookResponse, error)
Click to show internal directories.
Click to hide internal directories.