create

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReposCmd = &cobra.Command{
	Use:   "repos",
	Short: "Bulk create repos if not exist (skip if exist)",
	Run: func(cmd *cobra.Command, args []string) {
		cfg := utils.LoadConfig()

		repos := utils.ReadRepositoryYaml(utils.InputFile)
		svc := api.NewRepoService(cfg, utils.ProjectKey)
		var wg sync.WaitGroup
		sem := make(chan struct{}, 5)

		for _, repo := range repos {
			wg.Add(1)
			go func(r models.RepoEntity) {
				defer wg.Done()
				sem <- struct{}{}
				defer func() { <-sem }()
				svc.Create(repo)
			}(repo)
		}
		wg.Wait()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL