Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeRouteMatcher ¶ added in v0.4.0
func MakeRouteMatcher(opts ...MakeRouteMatcherOptions) func(pattern, topic string) bool
MakeRouteMatcher creates a configurable pattern matching function The returned function has the signature func(pattern, topic string) bool. When used with the Mux, "pattern" is the registered route pattern (eg. "users.*.profile") and "topic" is the actual topic being matched (eg. "users.123.profile")
Types ¶
type Entry ¶
type Entry struct {
Handler any
// contains filtered or unexported fields
}
func (*Entry) Unsubscribe ¶
func (i *Entry) Unsubscribe()
type MakeRouteMatcherOptions ¶ added in v0.4.0
type MakeRouteMatcherOptions struct {
Separator string // separator for splitting pattern/topic (default: "/")
OnlyFinalSegment bool // if true, multi-level wildcard (#) must be final segment (default: false)
PatternTransformer func(string) string
}
MakeRouteMatcherOptions configures the route matching behavior
type Option ¶
type Option func(m *Mux)
func WithEntryComparator ¶
func WithMatcher ¶ added in v0.4.0
func WithRouteMatcher ¶
type Subscription ¶
type Subscription interface {
Unsubscribe()
}
Click to show internal directories.
Click to hide internal directories.