// Copyright (c) 2024 Mattermost Community Enterprise // Registration of Outgoing OAuth Connection implementation package outgoing_oauth_connection import ( "github.com/mattermost/mattermost/server/public/model" "github.com/mattermost/mattermost/server/public/shared/mlog" "github.com/mattermost/mattermost/server/v8/channels/store" "github.com/mattermost/mattermost/server/v8/einterfaces" ) // OutgoingOAuthConnectionFactory is a function type that creates an OutgoingOAuthConnectionInterface type OutgoingOAuthConnectionFactory func(store store.Store, config func() *model.Config, logger mlog.LoggerIFace) einterfaces.OutgoingOAuthConnectionInterface // NewOutgoingOAuthConnectionFactory returns a factory function for creating OutgoingOAuthConnection interfaces func NewOutgoingOAuthConnectionFactory() OutgoingOAuthConnectionFactory { return func(store store.Store, config func() *model.Config, logger mlog.LoggerIFace) einterfaces.OutgoingOAuthConnectionInterface { cfg := &OutgoingOAuthConnectionConfig{ Store: store, Config: config, Logger: logger, } return NewOutgoingOAuthConnectionInterface(cfg) } } // CreateOutgoingOAuthConnectionInterface creates a new OutgoingOAuthConnection interface directly func CreateOutgoingOAuthConnectionInterface(store store.Store, config func() *model.Config, logger mlog.LoggerIFace) einterfaces.OutgoingOAuthConnectionInterface { cfg := &OutgoingOAuthConnectionConfig{ Store: store, Config: config, Logger: logger, } return NewOutgoingOAuthConnectionInterface(cfg) }