Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckCommand = &cobra.Command{ Use: "check", Short: "Check server configuration correctness", Long: `check reads the server configuration like the main command does, from a configuration file, command line flags, or environmental variables, and checks that the configuration is valid. Specify -v to see the configuration.`, Run: func(command *cobra.Command, args []string) { if err := configure(command); err != nil { die(errors.WrapPrefix(err, "Failed to read configuration from file, args, or env vars", 0)) } enabled := conf.DisableSchemesUpdate conf.DisableSchemesUpdate = true if _, err := requestorserver.New(conf); err != nil { die(errors.WrapPrefix(err, "Invalid configuration", 0)) } conf.DisableSchemesUpdate = enabled bts, _ := json.MarshalIndent(conf, "", " ") conf.Logger.Debug("Configuration: ", string(bts), "\n") }, }
View Source
var RootCommand = &cobra.Command{ Use: "irmad", Short: "IRMA server for verifying and issuing attributes", Run: func(command *cobra.Command, args []string) { if err := configure(command); err != nil { die(errors.WrapPrefix(err, "Failed to read configuration", 0)) } serv, err := requestorserver.New(conf) if err != nil { die(errors.WrapPrefix(err, "Failed to configure server", 0)) } stopped := make(chan struct{}) interrupt := make(chan os.Signal, 1) signal.Notify(interrupt, os.Interrupt, syscall.SIGTERM) go func() { if err := serv.Start(conf); err != nil { die(errors.WrapPrefix(err, "Failed to start server", 0)) } conf.Logger.Debug("Server stopped") stopped <- struct{}{} }() for { select { case <-interrupt: conf.Logger.Debug("Caught interrupt") serv.Stop() conf.Logger.Debug("Sent stop signal to server") case <-stopped: conf.Logger.Info("Exiting") close(stopped) close(interrupt) return } } }, }
View Source
var RunCommand = &cobra.Command{ Use: "run", Short: "Run server (same as specifying no command)", Run: RootCommand.Run, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.