Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "scrappy", Short: "Scrappy is a tool for scraping web pages", SilenceUsage: true, SilenceErrors: true, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { if err := viper.BindPFlags(cmd.PersistentFlags()); err != nil { return err } viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() viper.SetEnvPrefix("SCRAPPY") viper.AddConfigPath(".") viper.SetConfigName("env") err := viper.ReadInConfig() if _, ok := err.(viper.ConfigFileNotFoundError); ok { fmt.Printf("Error reading config file %v\n", err) return err } return nil }, RunE: func(cmd *cobra.Command, _ []string) error { logger := logger.CreateLogger() args, err := config.New() if err != nil { logger.Infof("Error: %v", err) return err } return startMainLoop(&args, logger) }, }
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.