eventsearcher

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

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

View Source
const (
	// PluginName defines the name for an events search plugin
	PluginName = "eventsearcher"
)

Variables

View Source
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.

View Source
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
	Username       string
	IP             string
	InstanceIDs    []string
	FromID         string
	Limit          int
	Order          int
	Role           string
}

CommonSearchParams defines common parameters for both filesystem and provider search

type FsEventSearch

type FsEventSearch struct {
	CommonSearchParams
	Actions    []string
	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, error)

SearchFsEvents implements the Searcher interface

func (*GRPCClient) SearchLogEvents added in v0.1.4

func (c *GRPCClient) SearchLogEvents(searchFilters *LogEventSearch) ([]byte, error)

SearchLogEvents implements the Searcher interface

func (*GRPCClient) SearchProviderEvents

func (c *GRPCClient) SearchProviderEvents(searchFilters *ProviderEventSearch) ([]byte, 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) SearchLogEvents added in v0.1.4

func (s *GRPCServer) SearchLogEvents(ctx context.Context, req *proto.LogEventsFilter) (*proto.SearchResponse, error)

SearchLogEvents implement the server side log 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 LogEventSearch added in v0.1.4

type LogEventSearch struct {
	CommonSearchParams
	Events    []int32
	Protocols []string
}

LogEventSearch defines the fields for a provider event search

type Plugin

type Plugin struct {
	plugin.Plugin
	Impl Searcher
}

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

func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer defines the GRPC server implementation for this plugin

type ProviderEventSearch

type ProviderEventSearch struct {
	CommonSearchParams
	Actions        []string
	ObjectName     string
	ObjectTypes    []string
	OmitObjectData bool
}

ProviderEventSearch defines the fields for a provider event search

type Searcher

type Searcher interface {
	SearchFsEvents(searchFilters *FsEventSearch) ([]byte, error)
	SearchProviderEvents(searchFilters *ProviderEventSearch) ([]byte, error)
	SearchLogEvents(searchFilters *LogEventSearch) ([]byte, error)
}

Searcher defines the interface for events search plugins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL