Documentation
¶
Index ¶
- Variables
- func CleanupClients()
- func RegisterSecPipelinePluginsServer(s grpc.ServiceRegistrar, srv SecPipelinePluginsServer)
- type DataStream
- func (*DataStream) Descriptor() ([]byte, []int)deprecated
- func (x *DataStream) GetData() []byte
- func (x *DataStream) GetId() string
- func (x *DataStream) GetIsComplete() bool
- func (x *DataStream) GetParentSrc() string
- func (x *DataStream) GetTotalLen() int64
- func (*DataStream) ProtoMessage()
- func (x *DataStream) ProtoReflect() protoreflect.Message
- func (x *DataStream) Reset()
- func (x *DataStream) String() string
- type Empty
- type Error
- type GRPCClient
- type GRPCServer
- type InputSchema
- type Plugin
- type PluginOption
- func WithCmdConfig(cmd *exec.Cmd) PluginOption
- func WithGRPCPlugin() PluginOption
- func WithHandshakeConfig(handshakeConfig plugin.HandshakeConfig) PluginOption
- func WithPath(path string) PluginOption
- func WithPluginImplementation(plugin SecPipelinePluginable) PluginOption
- func WithPluginProcessPath(path string) PluginOption
- type RunInputConfig
- type RunLoop
- type SecPipelineGRPCPlugin
- type SecPipelinePluginable
- type SecPipelinePluginsClient
- type SecPipelinePluginsServer
- type SecPipelinePlugins_RunClient
- type SecPipelinePlugins_RunServer
- type UnimplementedSecPipelinePluginsServer
- type UnsafeSecPipelinePluginsServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrJsonSchemaConvertion error = errors.New("failed to convert to json format") ErrJsonConvertion error = errors.New("failed to convert to/from json") )
var DefaultHandshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_SECPIPELINE_PLUGIN",
MagicCookieValue: "hello",
}
var File_pluginctl_plugins_proto protoreflect.FileDescriptor
var SecPipelinePlugins_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pluginctl.SecPipelinePlugins", HandlerType: (*SecPipelinePluginsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInputSchema", Handler: _SecPipelinePlugins_GetInputSchema_Handler, }, { MethodName: "Config", Handler: _SecPipelinePlugins_Config_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Run", Handler: _SecPipelinePlugins_Run_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "pluginctl/plugins.proto", }
SecPipelinePlugins_ServiceDesc is the grpc.ServiceDesc for SecPipelinePlugins service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func CleanupClients ¶
func CleanupClients()
func RegisterSecPipelinePluginsServer ¶
func RegisterSecPipelinePluginsServer(s grpc.ServiceRegistrar, srv SecPipelinePluginsServer)
Types ¶
type DataStream ¶
type DataStream struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` ParentSrc string `protobuf:"bytes,2,opt,name=parentSrc,proto3" json:"parentSrc,omitempty"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` IsComplete bool `protobuf:"varint,4,opt,name=isComplete,proto3" json:"isComplete,omitempty"` TotalLen int64 `protobuf:"varint,5,opt,name=totalLen,proto3" json:"totalLen,omitempty"` // contains filtered or unexported fields }
func (*DataStream) Descriptor
deprecated
func (*DataStream) Descriptor() ([]byte, []int)
Deprecated: Use DataStream.ProtoReflect.Descriptor instead.
func (*DataStream) GetData ¶
func (x *DataStream) GetData() []byte
func (*DataStream) GetId ¶
func (x *DataStream) GetId() string
func (*DataStream) GetIsComplete ¶
func (x *DataStream) GetIsComplete() bool
func (*DataStream) GetParentSrc ¶
func (x *DataStream) GetParentSrc() string
func (*DataStream) GetTotalLen ¶
func (x *DataStream) GetTotalLen() int64
func (*DataStream) ProtoMessage ¶
func (*DataStream) ProtoMessage()
func (*DataStream) ProtoReflect ¶
func (x *DataStream) ProtoReflect() protoreflect.Message
func (*DataStream) Reset ¶
func (x *DataStream) Reset()
func (*DataStream) String ¶
func (x *DataStream) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type GRPCClient ¶
type GRPCClient struct { Name string // contains filtered or unexported fields }
func (*GRPCClient) Config ¶
func (m *GRPCClient) Config(config []byte) error
func (*GRPCClient) GetInputSchema ¶
func (m *GRPCClient) GetInputSchema() ([]byte, error)
func (*GRPCClient) Run ¶
func (m *GRPCClient) Run(ctx context.Context, input <-chan *DataStream) (<-chan *DataStream, <-chan error)
type GRPCServer ¶
type GRPCServer struct { // This is the real implementation Impl SecPipelinePluginable Name string }
Here is the gRPC server that GRPCClient talks to.
func (*GRPCServer) Config ¶
func (m *GRPCServer) Config(ctx context.Context, config *RunInputConfig) (*Empty, error)
func (*GRPCServer) GetInputSchema ¶
func (m *GRPCServer) GetInputSchema(context.Context, *Empty) (*InputSchema, error)
func (*GRPCServer) Run ¶
func (m *GRPCServer) Run(stream SecPipelinePlugins_RunServer) error
type InputSchema ¶
type InputSchema struct { Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` // contains filtered or unexported fields }
func (*InputSchema) Descriptor
deprecated
func (*InputSchema) Descriptor() ([]byte, []int)
Deprecated: Use InputSchema.ProtoReflect.Descriptor instead.
func (*InputSchema) GetConfig ¶
func (x *InputSchema) GetConfig() []byte
func (*InputSchema) ProtoMessage ¶
func (*InputSchema) ProtoMessage()
func (*InputSchema) ProtoReflect ¶
func (x *InputSchema) ProtoReflect() protoreflect.Message
func (*InputSchema) Reset ¶
func (x *InputSchema) Reset()
func (*InputSchema) String ¶
func (x *InputSchema) String() string
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin(name string, opt ...PluginOption) *Plugin
func (*Plugin) Connect ¶
func (p *Plugin) Connect() (SecPipelinePluginable, error)
type PluginOption ¶
func WithCmdConfig ¶
func WithCmdConfig(cmd *exec.Cmd) PluginOption
func WithGRPCPlugin ¶
func WithGRPCPlugin() PluginOption
func WithHandshakeConfig ¶
func WithHandshakeConfig(handshakeConfig plugin.HandshakeConfig) PluginOption
func WithPath ¶
func WithPath(path string) PluginOption
func WithPluginImplementation ¶
func WithPluginImplementation(plugin SecPipelinePluginable) PluginOption
func WithPluginProcessPath ¶
func WithPluginProcessPath(path string) PluginOption
type RunInputConfig ¶
type RunInputConfig struct { Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` // contains filtered or unexported fields }
func (*RunInputConfig) Descriptor
deprecated
func (*RunInputConfig) Descriptor() ([]byte, []int)
Deprecated: Use RunInputConfig.ProtoReflect.Descriptor instead.
func (*RunInputConfig) GetConfig ¶
func (x *RunInputConfig) GetConfig() []byte
func (*RunInputConfig) ProtoMessage ¶
func (*RunInputConfig) ProtoMessage()
func (*RunInputConfig) ProtoReflect ¶
func (x *RunInputConfig) ProtoReflect() protoreflect.Message
func (*RunInputConfig) Reset ¶
func (x *RunInputConfig) Reset()
func (*RunInputConfig) String ¶
func (x *RunInputConfig) String() string
type RunLoop ¶
type RunLoop struct {
// contains filtered or unexported fields
}
func NewRunLoop ¶
func NewRunLoop() *RunLoop
func (*RunLoop) Recv ¶
func (rl *RunLoop) Recv(stream *DataStream) *DataStream
func (*RunLoop) Send ¶
func (rl *RunLoop) Send(stream *DataStream) []*DataStream
type SecPipelineGRPCPlugin ¶
type SecPipelineGRPCPlugin struct { // GRPCPlugin must still implement the Plugin interface plugin.NetRPCUnsupportedPlugin Impl SecPipelinePluginable Name string }
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (SecPipelineGRPCPlugin) GRPCClient ¶
func (p SecPipelineGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (SecPipelineGRPCPlugin) GRPCServer ¶
func (p SecPipelineGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type SecPipelinePluginable ¶
type SecPipelinePluginable interface { GetInputSchema() ([]byte, error) Config(config []byte) error Run(ctx context.Context, input <-chan *DataStream) (<-chan *DataStream, <-chan error) }
type SecPipelinePluginsClient ¶
type SecPipelinePluginsClient interface { GetInputSchema(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*InputSchema, error) Config(ctx context.Context, in *RunInputConfig, opts ...grpc.CallOption) (*Empty, error) Run(ctx context.Context, opts ...grpc.CallOption) (SecPipelinePlugins_RunClient, error) }
SecPipelinePluginsClient is the client API for SecPipelinePlugins service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSecPipelinePluginsClient ¶
func NewSecPipelinePluginsClient(cc grpc.ClientConnInterface) SecPipelinePluginsClient
type SecPipelinePluginsServer ¶
type SecPipelinePluginsServer interface { GetInputSchema(context.Context, *Empty) (*InputSchema, error) Config(context.Context, *RunInputConfig) (*Empty, error) Run(SecPipelinePlugins_RunServer) error // contains filtered or unexported methods }
SecPipelinePluginsServer is the server API for SecPipelinePlugins service. All implementations must embed UnimplementedSecPipelinePluginsServer for forward compatibility
type SecPipelinePlugins_RunClient ¶
type SecPipelinePlugins_RunClient interface { Send(*DataStream) error Recv() (*DataStream, error) grpc.ClientStream }
type SecPipelinePlugins_RunServer ¶
type SecPipelinePlugins_RunServer interface { Send(*DataStream) error Recv() (*DataStream, error) grpc.ServerStream }
type UnimplementedSecPipelinePluginsServer ¶
type UnimplementedSecPipelinePluginsServer struct { }
UnimplementedSecPipelinePluginsServer must be embedded to have forward compatible implementations.
func (UnimplementedSecPipelinePluginsServer) Config ¶
func (UnimplementedSecPipelinePluginsServer) Config(context.Context, *RunInputConfig) (*Empty, error)
func (UnimplementedSecPipelinePluginsServer) GetInputSchema ¶
func (UnimplementedSecPipelinePluginsServer) GetInputSchema(context.Context, *Empty) (*InputSchema, error)
type UnsafeSecPipelinePluginsServer ¶
type UnsafeSecPipelinePluginsServer interface {
// contains filtered or unexported methods
}
UnsafeSecPipelinePluginsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SecPipelinePluginsServer will result in compilation errors.