Documentation ¶
Index ¶
- Constants
- func GetHost(repo *gogit.Repository) string
- func GetURLParts(remoteURL string) parts
- func ParseGitRemote(log logger.Logger, workingDir string) (*gogit.Repository, error)
- func ParseRemoteURL(repo *gogit.Repository) string
- type Bootstrap
- type BootstrapCmdOptions
- type BootstrapCommon
- type BootstrapForge
- type BootstrapRaw
- type BootstrapWizard
- type BootstrapWizardCmd
- type BootstrapWizardTask
- type DefaultValueGetter
- type GitProvider
Constants ¶
const ( BranchOptionKey = "branch" HostnameOptionKey = "hostname" OwnerOptionKey = "owner" PasswordOptionKey = "password" PersonalOptionKey = "personal" PrivateKeyFileOptionKey = "private-key-file" PrivateOptionKey = "private" RepositoryOptionKey = "repository" PATOptionKey = "pat" URLOptionKey = "url" UsernameOptionKey = "username" )
Variables ¶
This section is empty.
Functions ¶
func GetHost ¶ added in v0.10.0
func GetHost(repo *gogit.Repository) string
func GetURLParts ¶
func GetURLParts(remoteURL string) parts
GetURLParts splits URL to URL parts. This takes inspiration from https://github.com/fluxcd/go-git-providers/blob/cda93bf5a5fa65bd994a60d6d3ef9ad119cfb684/gitprovider/repositoryref.go#L309 except it has to do it in reverse
func ParseGitRemote ¶
ParseGitRemote parses the git remote (if it exists) from the working directory to autofill some command options.
func ParseRemoteURL ¶
func ParseRemoteURL(repo *gogit.Repository) string
ParseRemoteURL extracts remote URL from the repository
Types ¶
type Bootstrap ¶ added in v0.10.0
type Bootstrap interface { RunBootstrapCmd(context.Context, *fluxexec.Flux) error SyncResources(context.Context, logger.Logger, []gitprovider.CommitFile) error }
func NewBootstrap ¶ added in v0.10.0
func NewBootstrap(clusterPath string, options BootstrapCmdOptions, provider GitProvider) Bootstrap
type BootstrapCmdOptions ¶ added in v0.10.0
type BootstrapCommon ¶ added in v0.10.0
type BootstrapCommon struct {
// contains filtered or unexported fields
}
type BootstrapForge ¶ added in v0.10.0
type BootstrapForge struct { BootstrapCommon // contains filtered or unexported fields }
func (*BootstrapForge) RunBootstrapCmd ¶ added in v0.10.0
func (*BootstrapForge) SyncResources ¶ added in v0.10.0
func (b *BootstrapForge) SyncResources(ctx context.Context, log logger.Logger, commitFiles []gitprovider.CommitFile) error
type BootstrapRaw ¶ added in v0.10.0
type BootstrapRaw struct { BootstrapCommon // contains filtered or unexported fields }
TODO: this needs to be implemented using plain go-git
func (*BootstrapRaw) RunBootstrapCmd ¶ added in v0.10.0
func (*BootstrapRaw) SyncResources ¶ added in v0.10.0
func (b *BootstrapRaw) SyncResources(ctx context.Context, log logger.Logger, commitFiles []gitprovider.CommitFile) error
type BootstrapWizard ¶
type BootstrapWizard struct {
// contains filtered or unexported fields
}
func NewBootstrapWizard ¶
func NewBootstrapWizard(log logger.Logger, gitProvider GitProvider, repo *gogit.Repository) (*BootstrapWizard, error)
NewBootstrapWizard creates a wizard to gather all bootstrap config options before running flux bootstrap.
func (*BootstrapWizard) BuildCmd ¶
func (wizard *BootstrapWizard) BuildCmd(log logger.Logger) BootstrapWizardCmd
BuildCmd builds flux bootstrap command options as key/values pairs.
type BootstrapWizardCmd ¶
type BootstrapWizardCmd struct { Provider GitProvider Options BootstrapCmdOptions }
type BootstrapWizardTask ¶
type BootstrapWizardTask struct {
// contains filtered or unexported fields
}
type DefaultValueGetter ¶
type DefaultValueGetter func(*gogit.Repository) string
type GitProvider ¶
type GitProvider int32
const ( GitProviderUnknown GitProvider = 0 GitProviderGitHub GitProvider = 1 GitProviderGitLab GitProvider = 2 GitProviderGit GitProvider = 3 GitProviderBitbucketServer GitProvider = 4 )
func ParseGitProvider ¶
func ParseGitProvider(hostname string) GitProvider
ParseGitProvider extracts git provider from the remote URL, if possible
func SelectGitProvider ¶
func SelectGitProvider(log logger.Logger) (GitProvider, error)
SelectGitProvider displays text inputs to enter or edit all command flag values.