Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "idl-repository", Short: "idl-repository stores all sorts of idls", Long: `long explanation here`, Run: func(cmd *cobra.Command, args []string) { settings := &repository.Settings{ Port: *port, } storage, err := storage.NewFileStorage(*storageDiretory) if err != nil { panic(err) } server := repository.NewServer(settings, storage) ctx, cancel := context.WithCancel(context.Background()) grp, ctx := errgroup.WithContext(ctx) grp.Go(server.Run(ctx)) waiter := make(chan os.Signal, 1) signal.Notify(waiter, syscall.SIGINT, syscall.SIGTERM) select { case <-waiter: case <-ctx.Done(): } cancel() if err := grp.Wait(); err != nil { panic(err) } }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.