scim/pkg/supplier/factory.go

23 lines
532 B
Go
Raw Normal View History

2022-06-10 11:51:19 +00:00
package supplier
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func NewServiceProviderSupplier(name string, config ServiceProviderConfig) (ServiceProviderSupplier, error) {
switch name {
case "rocketchat":
return &rocketchat{
// until the app is added to the marketplace.
sideLoading: true,
ServiceProviderConfig: config,
Client: resty.New().
SetBaseURL(config.Host).
SetHeader("Content-Type", "application/json"),
}, nil
}
return nil, fmt.Errorf("unkown service provider : %s", name)
}