Documentation ¶
Index ¶
Constants ¶
const (
// ServicePackPluginName ...
ServicePackPluginName = "servicepack"
)
Variables ¶
This section is empty.
Functions ¶
func GetHandshakeConfig ¶
func GetHandshakeConfig() hcplugin.HandshakeConfig
GetHandshakeConfig provides handshake config details. It is used by core and service packs.
Types ¶
type ServeOpts ¶
type ServeOpts struct { //Interface implementation Pack ServicePack // Logger is the logger that go-plugin will use. Logger hclog.Logger // Set NoLogOutputOverride to not override the log output with an hclog // adapter. This should only be used when running the plugin in // acceptance tests. NoLogOutputOverride bool }
ServeOpts are the configurations to serve a plugin.
type ServicePack ¶
type ServicePack interface {
RunProbes() error
}
ServicePack is the interface that we're exposing as a plugin.
type ServicePackPlugin ¶
type ServicePackPlugin struct { // Impl Injection Impl ServicePack }
ServicePackPlugin is the implementation of plugin.Plugin so we can serve/consume this
This has two methods: Server must return an RPC server for this plugin type. We construct a GreeterRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return GreeterRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
type ServicePackRPC ¶
type ServicePackRPC struct {
// contains filtered or unexported fields
}
ServicePackRPC is an implementation that talks over RPC
func (*ServicePackRPC) RunProbes ¶
func (g *ServicePackRPC) RunProbes() error
RunProbes returns a message
type ServicePackRPCServer ¶
type ServicePackRPCServer struct { // This is the real implementation Impl ServicePack }
ServicePackRPCServer is the RPC server that ServicePackRPC talks to, conforming to the requirements of net/rpc
func (*ServicePackRPCServer) RunProbes ¶
func (s *ServicePackRPCServer) RunProbes(args interface{}, resp *error) error
RunProbes is a wrapper for interface implementation