scim/pkg/supplier/factory.go
2022-06-10 13:51:19 +02:00

22 lines
532 B
Go

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)
}