Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // HandshakeConfig is prevents users from executing bad plugins // from the command line and be launched as a plugin only. // It is a UX feature, not a security feature. HandshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "BASIC_PLUGIN", MagicCookieValue: "hello", } )
Functions ¶
func LaunchPlugin ¶
func LaunchPlugin(authenticator Authenticator, name string)
LaunchPlugin launches a plugin
Types ¶
type Authenticator ¶
type Authenticator interface { //Authenticate(interface{}) map[string]string Authenticate(map[string]string) map[string]string }
Authenticator is the interface exposed as a plugin
func DispenseAuthenticator ¶
func DispenseAuthenticator(pluginPath string, level hclog.Level) (Authenticator, *plugin.Client)
DispenseAuthenticator loads an Authenticator plug-in into memory
type AuthenticatorPlugin ¶
type AuthenticatorPlugin struct { // Impl injection Impl Authenticator }
AuthenticatorPlugin has two methods: Server must return an RPC server for this plugin type. We construct a AuthenticatorRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return AuthenticatorRPC for this.
type AuthenticatorRPC ¶
type AuthenticatorRPC struct {
// contains filtered or unexported fields
}
AuthenticatorRPC is an Authenticator implementation that talks over RPC
func (*AuthenticatorRPC) Authenticate ¶
func (a *AuthenticatorRPC) Authenticate(dataIn map[string]string) (dataOut map[string]string)
Authenticate will call the Authenticate method of the plugin
type AuthenticatorRPCServer ¶
type AuthenticatorRPCServer struct { //This is the real implementation Impl Authenticator }
AuthenticatorRPCServer is the RPC server that AuthenticatorRPC talks to, conforming to net/rpc reqjuirements
func (*AuthenticatorRPCServer) Authenticate ¶
func (s *AuthenticatorRPCServer) Authenticate(args map[string]string, resp *map[string]string) error
Authenticate ... func (s *AuthenticatorRPCServer) Authenticate(args interface{}, resp *map[string]string) error {