Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config)
Option modifies config. Zero or more can be passed to Main.
func WithComponents ¶
func WithComponents(cs ...interface{}) Option
WithComponents specifies a list of components to serve from the plugin binary. This will append to the list of components to serve. You can currently only serve at most one of each type of plugin.
func WithMappers ¶
func WithMappers(ms ...interface{}) Option
WithMappers specifies a list of mappers to apply to the plugin.
Mappers are functions that take zero or more arguments and return one result (optionally with an error). These can be used to convert argument types as needed for your plugin functions. For example, you can convert a proto type to a richer Go struct.
Mappers must take zero or more arguments and return exactly one or two values where the second return type must be an error. Example:
func() *Value func() (*Value, error) -- the above with any arguments
This will append the mappers to the list of available mappers. A set of default mappers is always included to convert from SDK proto types to richer Go structs.
type ReattachConfig ¶
type ReattachConfig struct { Protocol string ProtocolVersion int Pid int Test bool Addr ReattachConfigAddr }
ReattachConfig holds the information Waypoint needs to be able to attach itself to a plugin process, so it can drive the process.
func DebugServe ¶
func DebugServe(ctx context.Context, opts ...Option) (ReattachConfig, <-chan struct{}, error)
DebugServe starts a plugin server in debug mode; this should only be used when the plugin will manage its own lifecycle. It is not recommended for normal usage; Serve is the correct function for that.
type ReattachConfigAddr ¶
ReattachConfigAddr is a JSON-encoding friendly version of net.Addr.
Directories ¶
Path | Synopsis |
---|---|
Package component has the interfaces for all the components that can be implemented.
|
Package component has the interfaces for all the components that can be implemented. |
Package datadir manages the data directories.
|
Package datadir manages the data directories. |
Package framework contains a high-level framework for writing Waypoint plugins.
|
Package framework contains a high-level framework for writing Waypoint plugins. |
resource
Package resource contains helpers around managing groups of resources.
|
Package resource contains helpers around managing groups of resources. |
internal
|
|
pkg/spinner
Package spinner is a simple package to add a spinner / progress indicator to any terminal application.
|
Package spinner is a simple package to add a spinner / progress indicator to any terminal application. |
pkg/spinner/_example
Example application that uses all of the available API options.
|
Example application that uses all of the available API options. |
pluginargs
Package pluginargs
|
Package pluginargs |
plugincomponent
Package plugincomponent has helpers to convert or expose component implementations for plugin proto structures.
|
Package plugincomponent has helpers to convert or expose component implementations for plugin proto structures. |
testproto
Package testproto contains some protobuf defintions that are used in internal tests.
|
Package testproto contains some protobuf defintions that are used in internal tests. |
internal-shared
|
|
proto
|
|
Package terminal is used by plugins to read and write to a terminal UI.
|
Package terminal is used by plugins to read and write to a terminal UI. |