@@ -3,8 +3,10 @@ package http
|
||||
import (
|
||||
"context"
|
||||
|
||||
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
ehsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/eventhistory/v0"
|
||||
"github.com/owncloud/ocis/v2/services/userlog/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/userlog/pkg/metrics"
|
||||
"github.com/urfave/cli/v2"
|
||||
@@ -24,6 +26,8 @@ type Options struct {
|
||||
Namespace string
|
||||
Store store.Store
|
||||
Consumer events.Consumer
|
||||
GatewayClient gateway.GatewayAPIClient
|
||||
HistoryClient ehsvc.EventHistoryService
|
||||
RegisteredEvents []events.Unmarshaller
|
||||
}
|
||||
|
||||
@@ -94,6 +98,20 @@ func Consumer(consumer events.Consumer) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Gateway provides a function to configure the gateway client
|
||||
func Gateway(gw gateway.GatewayAPIClient) Option {
|
||||
return func(o *Options) {
|
||||
o.GatewayClient = gw
|
||||
}
|
||||
}
|
||||
|
||||
// History provides a function to configure the event history client
|
||||
func History(h ehsvc.EventHistoryService) Option {
|
||||
return func(o *Options) {
|
||||
o.HistoryClient = h
|
||||
}
|
||||
}
|
||||
|
||||
// RegisteredEvents provides a function to register events
|
||||
func RegisteredEvents(evs []events.Unmarshaller) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
Reference in New Issue
Block a user