shoebill/internal/providers/types.go

22 lines
517 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 {
2023-10-12 16:02:14 +00:00
SyncState(diff.ReleasesDiffs, diff.RepositoriesDiffs) error
2023-07-20 09:26:25 +00:00
}
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)
}
}