Builder
Warning
This content is part of the legacy version of Waypoint that is no longer actively maintained. For additional information on the new vision of Waypoint, check out this blog post and the HCP Waypoint documentation.
https://pkg.go.dev/github.com/hashicorp/waypoint-plugin-sdk/component#Builder
The builder component is responsible for building your application code, this may be the execution of Docker build, build packs, or running language specific tools such as go build. This plugin is called when running the waypoint build command.
To implement the build component you implement the Builder interface, Builder has a single method BuildFunc that returns the function to be called by Waypoint.
The signature of the function you return from BuildFunc
can accept parameters from the list of Default Parameters are
required. The output parameters are a Go struct which is serializable to Protocol Buffers binary format and an error.
In the example below the function returns an instance of the struct Binary, returning this type makes it available
to be injected into the next phase which is the Registry plugin. If an error is returned Waypoint would stop execution
and return the error message to the user.