Documentation
¶
Overview ¶
Package caddy provides a handler for Caddy Server (https://caddyserver.com/) allowing to transform any Caddy instance into a Mercure hub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mercure ¶
type Mercure struct { // Allow subscribers with no valid JWT. Anonymous bool `json:"anonymous,omitempty"` // Dispatch updates when subscriptions are created or terminated Subscriptions bool `json:"subscriptions,omitempty"` // Enable the demo. Demo bool `json:"demo,omitempty"` // Enable the UI. UI bool `json:"ui,omitempty"` // Maximum duration before closing the connection, defaults to 600s, set to 0 to disable. WriteTimeout *caddy.Duration `json:"write_timeout,omitempty"` // Maximum dispatch duration of an update. DispatchTimeout caddy.Duration `json:"dispatch_timeout,omitempty"` // Frequency of the heartbeat, defaults to 40s. Heartbeat caddy.Duration `json:"heartbeat,omitempty"` // JWT key and signing algorithm to use for publishers. PublisherJWT JWTConfig `json:"publisher_jwt,omitempty"` // JWT key and signing algorithm to use for subscribers. SubscriberJWT JWTConfig `json:"subscriber_jwt,omitempty"` // Origins allowed to publish updates PublishOrigins []string `json:"publish_origins,omitempty"` // Allowed CORS origins. CORSOrigins []string `json:"cors_origins,omitempty"` // Transport to use. TransportURL string `json:"transport_url,omitempty"` // Triggers use of LRU topic selector cache and avoidance of select priority queue (recommend 10,000 - 1,000,000) LRUShardSize *int64 `json:"lru_shard_size,omitempty"` // The name of the authorization cookie. Defaults to "mercureAuthorization". CookieName string `json:"cookie_name,omitempty"` // The version of the Mercure protocol to be backward compatible with (only version 7 is supported) ProtocolVersionCompatibility int `json:"protocol_version_compatibility,omitempty"` // contains filtered or unexported fields }
Mercure implements a Mercure hub as a Caddy module. Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way.
func (Mercure) CaddyModule ¶
func (Mercure) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
Click to show internal directories.
Click to hide internal directories.