Creation of plugin_main.go

EdgeStreaming Plugin is created as a standalone execution module.

Therefore, the "main" function must be implemented.

 

  1. Create the plugin_main.go file directly under the "external" folder and define as follows:

    package main
    
    import ( 
        "os" 
    
        // Import the package of the created plugin 
        "github.com/saison-sherpa/es-agent/external/plugin" 
        _ "github.com/saison-sherpa/es-agent/sample/plugin"
    )
    
    func main() {
        if err := plugin.NewServer().ListenAndServe(); err != nil {
            os.Exit(1)
        }
    }
    

     

    = Remarks =

    The implemented content in plugin_main.go is always the same except for the part for importing plugin packages.

     

This completes implementation in the execution environment.

 

For details on implementation of plugins in the execution environment, refer to the following:

http://docs.sensorbee.io/en/latest/server_programming.html