Documentation
¶
Index ¶
Constants ¶
View Source
const PluginGlob = "logproxy-filter-*"
PluginGlob is the glob pattern used to find plugins.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "6656191c-a4af-48a7-934f-ed05cd91dcc8",
}
Handshake is a common handshake that is shared by shared and host.
View Source
var PluginMap = map[string]plugin.Plugin{ "filter": &FilterGRPCPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type FilterGRPCClient ¶
type FilterGRPCClient struct {
// contains filtered or unexported fields
}
type FilterGRPCPlugin ¶
type FilterGRPCPlugin struct { // GRPCPlugin must still implement the Plugin interface plugin.Plugin // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl Filter }
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*FilterGRPCPlugin) GRPCClient ¶
func (p *FilterGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*FilterGRPCPlugin) GRPCServer ¶
func (p *FilterGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type FilterGRPCServer ¶
type FilterGRPCServer struct { proto.UnimplementedFilterServer // This is the real implementation Impl Filter }
Here is the gRPC server that FilterGRPCClient talks to.
func (*FilterGRPCServer) Filter ¶
func (m *FilterGRPCServer) Filter(ctx context.Context, req *proto.FilterRequest) (*proto.FilterResponse, error)
type Plugin ¶
type Plugin struct { // Path and Args are the method used to invocate this plugin. // These are the only two values that need to be set manually. Once // these are set, call Load to load the plugin. Path string `json:"path,omitempty"` Args []string `json:"args"` App Filter }
Plugin is a single plugin that has been loaded.
type PluginManager ¶
type PluginManager struct { // PluginDirs are the directories where plugins can be found. // Any plugins with the same types found later (higher index) will // override earlier (lower index) directories. PluginDirs []string // contains filtered or unexported fields }
PluginManager is responsible for discovering and starting plugins.
func (*PluginManager) Discover ¶
func (m *PluginManager) Discover() error
Discover will find all the available plugin binaries. Each time this is called it will override any previously discovered plugins.
func (*PluginManager) LoadAll ¶
func (m *PluginManager) LoadAll() error
LoadAll will launch every plugin and add it to the CoreConfig given.
func (*PluginManager) Plugins ¶
func (m *PluginManager) Plugins() []*Plugin
Plugins returns the loaded plugins.
Click to show internal directories.
Click to hide internal directories.