Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GitProviderAddCmd = &cobra.Command{ Use: "add", Aliases: []string{"new", "register"}, Short: "Register a Git provider", RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() apiClient, err := apiclient_util.GetApiClient(nil) if err != nil { return err } gitProviders, res, err := apiClient.GitProviderAPI.ListGitProviders(ctx).Execute() if err != nil { return apiclient_util.HandleErrorResponse(res, err) } existingAliases := util.ArrayMap(gitProviders, func(gp apiclient.GitProvider) string { return gp.Alias }) for _, gp := range gitProviders { existingAliases = append(existingAliases, gp.Alias) } setGitProviderConfig := apiclient.SetGitProviderConfig{} setGitProviderConfig.BaseApiUrl = new(string) setGitProviderConfig.Username = new(string) setGitProviderConfig.Alias = new(string) err = gitprovider_view.GitProviderCreationView(ctx, apiClient, &setGitProviderConfig, existingAliases) if err != nil { return err } if setGitProviderConfig.ProviderId == "" { return nil } res, err = apiClient.GitProviderAPI.SetGitProvider(ctx).GitProviderConfig(setGitProviderConfig).Execute() if err != nil { return apiclient_util.HandleErrorResponse(res, err) } views.RenderInfoMessage("Git provider has been registered") return nil }, }
View Source
var GitProviderCmd = &cobra.Command{ Use: "git-providers", Aliases: []string{"git-provider", "gp"}, Short: "Manage Git providers", GroupID: util.SERVER_GROUP, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.