Skip to content

Commit

Permalink
removing boilerplate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iAnatoly committed Jul 31, 2021
1 parent 37edfe6 commit b996c23
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,17 @@ var pollIntervalDisabled = flag.Bool("poll_interval_disabled", false, "set to tr
var configFile = flag.String("config", "", "path to the config file for this plugin")
var err error

// This is designed to be simple; Just change the import above and you're good.
//
// However, if you want to do all your config in code, you can like so:
//
// // initialize your plugin with any settngs you want
// myInput := &mypluginname.MyPlugin{
// DefaultSettingHere: 3,
// }
//
// shim := shim.New()
//
// shim.AddInput(myInput)
//
// // now the shim.Run() call as below. Note the shim is only intended to run a single plugin.
//
func main() {
// parse command line options
flag.Parse()
if *pollIntervalDisabled {
*pollInterval = shim.PollIntervalDisabled
}

// create the shim. This is what will run your plugins.
// create the shim. This is what will run the plugin.
shim := shim.New()

// If no config is specified, all imported plugins are loaded.
// otherwise follow what the config asks for.
// Check for settings from a config toml file,
// (or just use whatever plugins were imported above)
err = shim.LoadConfig(configFile)
if err != nil {
fmt.Fprintf(os.Stderr, "Err loading input: %s\n", err)
Expand Down

0 comments on commit b996c23

Please sign in to comment.