Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StartCmd = &cobra.Command{ Use: "start", Short: "starts the main process by reading the config file", SilenceUsage: false, SilenceErrors: true, Example: `# clean the desired files on target bucket s3-manager clean --min-size-mb=1 --max-size-mb=1000 --keep-last-n-files=2 --sort-by=lastModificationDate --order=ascending `, RunE: func(cmd *cobra.Command, args []string) error { cfg := cmd.Context().Value(options.ConfigKey{}).(*config.Config) client := cmd.Context().Value(options.S3ClientKey{}).(aws.S3ClientAPI) announcers := cmd.Context().Value(options.AnnouncerKey{}).([]announce.Announcer) logger := cmd.Context().Value(options.LoggerKey{}).(zerolog.Logger) go func() { sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) <-sigChan logger.Info().Msg("interrupt signal received., shutting down...") cancel() }() if err := feed.Filter(ctx, cfg, client, announcers); err != nil { logger.Error().Err(err).Msg("filtering process failed, shutting down...") return err } return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.