Documentation
¶
Overview ¶
Package eventsearcher defines the interface and the GRPC implementation for events search plugins. Events search plugins allow to search for filesystem and provider events.
Index ¶
Constants ¶
const (
// PluginName defines the name for an events search plugin
PluginName = "eventsearcher"
)
Variables ¶
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "SFTPGO_PLUGIN_EVENTSEARCHER",
MagicCookieValue: "2b523805-0279-471c-895e-6c0d39002ca4",
}
Handshake is a common handshake that is shared by plugin and host.
var PluginMap = map[string]plugin.Plugin{ PluginName: &Plugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type CommonSearchParams ¶
type CommonSearchParams struct {
StartTimestamp int64
EndTimestamp int64
Actions []string
Username string
IP string
InstanceIDs []string
ExcludeIDs []string
Limit int
Order int
Role string
}
CommonSearchParams defines common parameters for both filesystem and provider search
type FsEventSearch ¶
type FsEventSearch struct {
CommonSearchParams
SSHCmd string
Protocols []string
Statuses []int32
FsProvider int
Bucket string
Endpoint string
}
FsEventSearch defines the fields for a filesystem event search
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is an implementation of Notifier interface that talks over RPC.
func (*GRPCClient) SearchFsEvents ¶
func (c *GRPCClient) SearchFsEvents(searchFilters *FsEventSearch) ([]byte, []string, []string, error)
SearchFsEvents implements the Searcher interface
func (*GRPCClient) SearchProviderEvents ¶
func (c *GRPCClient) SearchProviderEvents(searchFilters *ProviderEventSearch) ([]byte, []string, []string, error)
SearchProviderEvents implements the Searcher interface
type GRPCServer ¶
type GRPCServer struct {
Impl Searcher
}
GRPCServer defines the gRPC server that GRPCClient talks to.
func (*GRPCServer) SearchFsEvents ¶
func (s *GRPCServer) SearchFsEvents(ctx context.Context, req *proto.FsEventsFilter) (*proto.SearchResponse, error)
SearchFsEvents implements the server side fs events search method
func (*GRPCServer) SearchProviderEvents ¶
func (s *GRPCServer) SearchProviderEvents(ctx context.Context, req *proto.ProviderEventsFilter) (*proto.SearchResponse, error)
SearchProviderEvents implement the server side provider events search method
type Plugin ¶
Plugin defines the implementation to serve/connect to a event search plugin
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient defines the GRPC client implementation for this plugin
func (*Plugin) GRPCServer ¶
GRPCServer defines the GRPC server implementation for this plugin
type ProviderEventSearch ¶
type ProviderEventSearch struct {
CommonSearchParams
ObjectName string
ObjectTypes []string
OmitObjectData bool
}
ProviderEventSearch defines the fields for a provider event search