Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrTooManyArguments = "too many arguments. please provide target file name. regex is accepted" ErrNoArgument = "no argument provided. 'file' subcommand takes your desired file name to search in target bucket" )
Variables ¶
View Source
var ( FileCmd = &cobra.Command{ Use: "file", Short: "", SilenceUsage: true, PreRunE: func(cmd *cobra.Command, args []string) error { svc = cmd.Context().Value(rootopts.S3SvcKey{}).(s3iface.S3API) rootOpts := cmd.Context().Value(rootopts.OptsKey{}).(*rootopts.RootOptions) searchOpts.RootOptions = rootOpts logger = logging.GetLogger(searchOpts.RootOptions) if err := checkFlags(logger, args); err != nil { return err } searchOpts.FileName = args[0] return nil }, RunE: func(cmd *cobra.Command, args []string) (err error) { files, err := aws.GetDesiredFiles(svc, searchOpts) if err != nil { logger.Error(). Str("fileName", searchOpts.FileName). Str("error", err.Error()). Msg("an error occurred while fetching desired files") return err } if len(files) == 0 { logger.Warn(). Str("fileName", searchOpts.FileName). Msg("no file found with the specified fileName or pattern") return nil } for _, v := range files { fmt.Println(v) } return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.