2023-07-20 09:26:25 +00:00
|
|
|
package providers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-08-02 15:00:34 +00:00
|
|
|
"git.badhouseplants.net/allanger/shoebill/internal/utils/diff"
|
|
|
|
"git.badhouseplants.net/allanger/shoebill/internal/utils/githelper"
|
2023-07-20 09:26:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Provider interface {
|
|
|
|
SyncState(diff diff.Diff) error
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewProvider(provider, path string, gh githelper.Githelper) (Provider, error) {
|
|
|
|
switch provider {
|
|
|
|
case "flux":
|
|
|
|
return FluxProvider(path, gh), nil
|
|
|
|
default:
|
|
|
|
return nil, fmt.Errorf("provider is not supported: %s", provider)
|
|
|
|
}
|
|
|
|
}
|