Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
44 lines
994 B
Go
44 lines
994 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
hplugin "github.com/hashicorp/go-plugin"
|
|
|
|
"github.com/ignite/cli/v29/ignite/pkg/errors"
|
|
"github.com/ignite/cli/v29/ignite/services/plugin"
|
|
)
|
|
|
|
type app struct{}
|
|
|
|
func (app) Manifest(context.Context) (*plugin.Manifest, error) {
|
|
return &plugin.Manifest{
|
|
Name: "execute_fail",
|
|
}, nil
|
|
}
|
|
|
|
func (app) Execute(context.Context, *plugin.ExecutedCommand, plugin.ClientAPI) error {
|
|
return errors.New("fail")
|
|
}
|
|
|
|
func (app) ExecuteHookPre(context.Context, *plugin.ExecutedHook, plugin.ClientAPI) error {
|
|
return nil
|
|
}
|
|
|
|
func (app) ExecuteHookPost(context.Context, *plugin.ExecutedHook, plugin.ClientAPI) error {
|
|
return nil
|
|
}
|
|
|
|
func (app) ExecuteHookCleanUp(context.Context, *plugin.ExecutedHook, plugin.ClientAPI) error {
|
|
return nil
|
|
}
|
|
|
|
func main() {
|
|
hplugin.Serve(&hplugin.ServeConfig{
|
|
HandshakeConfig: plugin.HandshakeConfig(),
|
|
Plugins: map[string]hplugin.Plugin{
|
|
"execute_fail": plugin.NewGRPC(&app{}),
|
|
},
|
|
GRPCServer: hplugin.DefaultGRPCServer,
|
|
})
|
|
}
|