Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "oscanner", Short: "`oscanner`", Long: "`oscanner`", Run: func(cmd *cobra.Command, args []string) { if showVersion { fmt.Printf("%v\n", version.Get()) return } cmd.Usage() }, }
RootCmd is the main command for the 'registry' binary.
View Source
var ServeCmd = &cobra.Command{ Use: "serve <config>", Short: "`serve` serves requests to scan", Long: "`serve` serves requests to scan.", Run: func(cmd *cobra.Command, args []string) { config, err := resolveConfiguration(args) if err != nil { fmt.Fprintf(os.Stderr, "configuration error: %v\n", err) cmd.Usage() os.Exit(1) } if err := configureLogging(config); err != nil { fmt.Fprintf(os.Stderr, "error configuring logger: %v", err) os.Exit(1) } if err := database.NewDB(config).Init(); err != nil { log.Fatalln(err) } uuid.Loggerf = log.Warnf in, err := instance.NewInstance(config) if err != nil { log.Fatalln(err) } registry, err := NewServer(in) if err != nil { log.Fatalln(err) } if err = registry.ListenAndServe(); err != nil { log.Fatalln(err) } }, }
ServeCmd is a cobra command for running the registry.
Functions ¶
Types ¶
type HTTPHandler ¶
func (*HTTPHandler) ServeHTTP ¶
func (o *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.