Creating a Plugin

    Run , and dtm will automatically generate the following file.

    This is the only main entrance to the plugin code.

    You do not need to change this file. If you want, feel free to submit a pull request to change the plugin template directly.

    This is the automatically generated plugin documentation.

    Please fill in the main logic of the plugin here.

    You can check out our document for detailed instruction on the project layout.

    Each plugin needs to satisfy all the interfaces defined in the plugin engine.

    At the moment, there are 4 interfaces, which might be subject to change. Currently, the three interfaces are:

    Delete interface returns two values . It returns (true, nil) if there is no error; otherwise (false, error) will be returned.

    If no error occurred, the return value would be (true, nil). Otherwise, the result would be (false, error).

    DevStream uses go plugin to implement custom DevOps plugins.

    When you execute a command which calls any of the interfaces(Create, , Update, Delete), devstream’s pluginengine will call the to load the plugin, get the variable DevStreamPlugin that implements the DevStreamPlugin interface, and then you can call the corresponding plugin logic functions. This is why it is not recommended to modify the /cmd/plugin/YOUR-PLUGIN-NAME/main.go file directly.