shoebill/internal/providers/types.go

22 lines
489 B
Go
Raw Normal View History

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
}
2023-10-11 12:14:20 +00:00
func NewProvider(provider, path, sopsBin string, gh githelper.Githelper) (Provider, error) {
2023-07-20 09:26:25 +00:00
switch provider {
case "flux":
2023-10-11 12:14:20 +00:00
return FluxProvider(path, sopsBin, gh), nil
2023-07-20 09:26:25 +00:00
default:
return nil, fmt.Errorf("provider is not supported: %s", provider)
}
}