shoebill/internal/providers/types.go
2023-10-12 18:02:14 +02:00

22 lines
517 B
Go

package providers
import (
"fmt"
"git.badhouseplants.net/allanger/shoebill/internal/utils/diff"
"git.badhouseplants.net/allanger/shoebill/internal/utils/githelper"
)
type Provider interface {
SyncState(diff.ReleasesDiffs, diff.RepositoriesDiffs) error
}
func NewProvider(provider, path, sopsBin string, gh githelper.Githelper) (Provider, error) {
switch provider {
case "flux":
return FluxProvider(path, sopsBin, gh), nil
default:
return nil, fmt.Errorf("provider is not supported: %s", provider)
}
}