Documentation
¶
Index ¶
- func ListenAndServe(ctx context.Context, addr string, handler http.Handler) error
- type AccessConfig
- type AccessLogMode
- type GitHubOAuthConfig
- type HomeLinkConfig
- type OpenClawIDConfig
- type Options
- type PushNotification
- type PushNotifier
- type PushoverNotifier
- type Server
- type WebPushConfig
- type WebPushNotifier
- type WebPushSubscriptionStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessConfig ¶ added in v0.2.1
type AccessLogMode ¶ added in v0.5.0
type AccessLogMode string
AccessLogMode selects how much of the per-request access log the server writes. The zero value logs every request, which is what operators got before the mode existed.
const ( AccessLogAll AccessLogMode = "all" AccessLogErrors AccessLogMode = "errors" AccessLogOff AccessLogMode = "off" )
type GitHubOAuthConfig ¶
type HomeLinkConfig ¶ added in v0.4.0
HomeLinkConfig points the workspace rail's home button somewhere other than the ClickClack landing page, for deployments that live inside a larger product. Values are validated by config.Config.ValidateServe before New; empty fields keep the built-in destination and label.
type OpenClawIDConfig ¶ added in v0.4.0
type OpenClawIDConfig struct {
ClientID string
ClientSecret string
Issuer string
PublicURL string
AuthURL string
TokenURL string
HTTPClient *http.Client
}
OpenClawIDConfig configures browser sign-in through the first-party OpenClaw ID OIDC provider (Better Auth OAuth 2.1 at id.openclaw.ai).
func (OpenClawIDConfig) ApplyDiscovery ¶ added in v0.6.0
func (c OpenClawIDConfig) ApplyDiscovery(ctx context.Context) (OpenClawIDConfig, error)
ApplyDiscovery fills unset endpoints from issuer metadata, preserving each explicit override. Only the default OpenClaw ID issuer can fall back when discovery is unavailable; malformed metadata always fails closed.
type Options ¶
type Options struct {
UploadDir string
UploadStorage uploadstore.Store
GitHubOAuth GitHubOAuthConfig
OpenClawID OpenClawIDConfig
Access AccessConfig
FrontendURL string
PublicAPIURL string
HomeLink HomeLinkConfig
EmbedFrameAncestors []string
CookieNames authpolicy.CookieNames
DisableDevAuth bool
PasswordAuthEnabled bool
PushNotifier PushNotifier
WebPushNotifier PushNotifier
WebPushPublicKey string
MetricsEnabled bool
AccessLog AccessLogMode
Environment string
Version string
Commit string
// contains filtered or unexported fields
}
type PushNotification ¶
type PushNotification struct {
RecipientKey string
Title string
Message string
UserID string
MessageID string
Tag string
URL string
Subscriptions []store.PushSubscriptionTarget
}
PushNotification is one alert for one recipient. Pushover reads the recipient key, the title, and the message. The web push notifier reads the title and the rest and ignores the key; it is handed no message, because it reads the text from the stored message when the push is sent.
type PushNotifier ¶
type PushNotifier interface {
Notify(ctx context.Context, notification PushNotification) error
}
type PushoverNotifier ¶
func NewPushoverNotifier ¶
func NewPushoverNotifier(token string) *PushoverNotifier
func (*PushoverNotifier) Notify ¶
func (p *PushoverNotifier) Notify(ctx context.Context, notification PushNotification) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CleanupPendingUploadObjects ¶ added in v0.2.0
type WebPushConfig ¶ added in v0.6.0
WebPushConfig is the application server identity used for every push.
type WebPushNotifier ¶ added in v0.6.0
type WebPushNotifier struct {
// contains filtered or unexported fields
}
WebPushNotifier delivers notifications to browser push services from a bounded worker pool, off the request path, and sweeps the devices that can no longer receive.
func NewWebPushNotifier ¶ added in v0.6.0
func NewWebPushNotifier(config WebPushConfig, subscriptions WebPushSubscriptionStore) *WebPushNotifier
NewWebPushNotifier builds a notifier that sends through the same outbound policy as callbacks: no proxy, no redirects, and no destination inside the deployment's own network.
func (*WebPushNotifier) Close ¶ added in v0.6.0
func (n *WebPushNotifier) Close()
Close stops new deliveries and gives the worker pool a bounded drain.
func (*WebPushNotifier) Notify ¶ added in v0.6.0
func (n *WebPushNotifier) Notify(_ context.Context, notification PushNotification) error
Notify queues deliveries without waiting for push services.
type WebPushSubscriptionStore ¶ added in v0.6.0
type WebPushSubscriptionStore interface {
GetPushSubscriptionDelivery(ctx context.Context, userID, endpoint, currentKeyID string) (store.PushSubscriptionTarget, error)
GetMessage(ctx context.Context, messageID, userID string) (store.Message, error)
GetChannelNotificationPreference(ctx context.Context, channelID, userID string) (string, error)
ListMentionedUserIDs(ctx context.Context, workspaceID, body string) ([]string, error)
DeletePushSubscription(ctx context.Context, userID, endpoint string) error
MarkPushSubscriptionSuccess(ctx context.Context, userID, endpoint string) error
MarkPushSubscriptionFailure(ctx context.Context, userID, endpoint string, retryAfter time.Duration) (int64, error)
PrunePushSubscriptions(ctx context.Context, currentKeyID string, now time.Time) (store.PushPruneResult, error)
}
WebPushSubscriptionStore is the store contract used by delivery workers.
Source Files
¶
- access.go
- access_log.go
- actor.go
- auth.go
- bot_scope.go
- bots.go
- callback_http.go
- callback_http_client_default.go
- channel_notifications.go
- channels.go
- csrf.go
- direct.go
- event_delivery.go
- github.go
- home_link.go
- integrations.go
- me_push.go
- messages.go
- mutations.go
- notifications.go
- observability.go
- openclawid.go
- origins.go
- pins.go
- profile.go
- pushover.go
- ratelimit.go
- reads.go
- realtime.go
- responses.go
- routes.go
- search.go
- server.go
- slash_commands.go
- spa.go
- upload_cleanup.go
- uploads.go
- webpush.go
- webpush_endpoint.go
- workspaces.go