Skip to content

Use new plugin sdk interface to build example plugin #5699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/app/pipedv1/plugin/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
)

func main() {
sdk.RegisterStagePlugin(&plugin{})
plugin, err := sdk.NewPlugin("example", "0.0.1", sdk.WithStagePlugin(&plugin{}))
if err != nil {
log.Fatalln(err)
}

Check warning on line 27 in pkg/app/pipedv1/plugin/example/main.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/pipedv1/plugin/example/main.go#L24-L27

Added lines #L24 - L27 were not covered by tests

if err := sdk.Run(); err != nil {
if err := plugin.Run(); err != nil {

Check warning on line 29 in pkg/app/pipedv1/plugin/example/main.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/pipedv1/plugin/example/main.go#L29

Added line #L29 was not covered by tests
log.Fatalln(err)
}
}
2 changes: 2 additions & 0 deletions pkg/app/pipedv1/plugin/example/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ type plugin struct{}
type config struct{}

// Name implements sdk.Plugin.
// TODO: remove this method after changing the sdk.StagePlugin interface.
func (p *plugin) Name() string {
return "example"
}

// Version implements sdk.Plugin.
// TODO: remove this method after changing the sdk.StagePlugin interface.
func (p *plugin) Version() string {
return "0.0.1"
}
Expand Down