eventsearcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 4

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
	Actions        []string
	Username       string
	IP             string
	InstanceIDs    []string
	ExcludeIDs     []string
	Limit          int
	Order          int
}

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

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
	ObjectName  string
	ObjectTypes []string
}

ProviderEventSearch defines the fields for a provider event search

type Searcher

type Searcher interface {
	SearchFsEvents(searchFilters *FsEventSearch) ([]byte, []string, []string, error)
	SearchProviderEvents(searchFilters *ProviderEventSearch) ([]byte, []string, []string, 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