organized api packages into a unified constructor

This commit is contained in:
2026-01-24 13:12:54 -07:00
parent d6d0bf1b4c
commit e0597b31e8
4 changed files with 71 additions and 33 deletions
+5
View File
@@ -29,12 +29,17 @@ func NewUpdateNotificationPublisher(
}
}
// Trim produces an *UpdateNotificationPublisher with the pathPattern
// trimmed from events otherwise published by p.
func (p *UpdateNotificationPublisher) Trim(pathPattern string) *UpdateNotificationPublisher {
p2 := *p
p2.trimBasePath = path.Join(p2.trimBasePath, pathPattern)
return &p2
}
// Group produces an *UpdateNotificationPublisher with the pathPattern
// appended to the base path used by p, if any, in publishing events.
// If no base path was set to p, then pathPattern becomes the base path.
func (p *UpdateNotificationPublisher) Group(pathPattern string) *UpdateNotificationPublisher {
p2 := *p
p2.basePathPattern = path.Join(p2.basePathPattern, pathPattern)