organized api packages into a unified constructor
This commit is contained in:
@@ -49,6 +49,10 @@ func NewAuth(
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Auth) GetAuthenticator() *authentication.Authenticator {
|
||||
return a.auth
|
||||
}
|
||||
|
||||
// Identify will add an Identity to the context that can then be retrieved via GetIdentity.
|
||||
func (a *Auth) Identify(c *gin.Context) {
|
||||
if err := a.addIdentity(c); err != nil {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user