package agent import ( "flag" ) // Device Agent Configuration type Config struct { ClassesPath string LogLevel string EnablePprof bool Workers int StartServer bool } // queueWorkers is number of workers to process device updates var defaultQueueWorkers = 3 // BindFlags will bind the arguments/env vars to the configuration struct func (cfg *Config) BindFlags(fs *flag.FlagSet) { fs.StringVar( &cfg.ClassesPath, "classes-path", "/etc", "path to device persistence dir", ) fs.StringVar( &cfg.LogLevel, "log-level", "info", "log level for device agent", ) fs.IntVar( &cfg.Workers, "workers", defaultQueueWorkers, "number of workers to handle device event updates", ) fs.BoolVar( &cfg.EnablePprof, "pprof", false, "enables pprof endpoint", ) fs.BoolVar( &cfg.StartServer, "start", true, "indicates whether to start the device agent server or exit gracefully", ) }