dispatcher

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	// contains filtered or unexported fields
}

func NewBatcher

func NewBatcher(userContext am.UserContext, addressClient am.AddressService, batchCount int) *Batcher

func (*Batcher) Add

func (b *Batcher) Add(result *am.ScanGroupAddress)

func (*Batcher) Count

func (b *Batcher) Count() int32

func (*Batcher) Done

func (b *Batcher) Done()

func (*Batcher) Drain

func (b *Batcher) Drain() map[string]*am.ScanGroupAddress

func (*Batcher) Init

func (b *Batcher) Init() error

func (*Batcher) InsertBatch

func (b *Batcher) InsertBatch()

type DependentServices

type DependentServices struct {
	EventClient    am.EventService                    // used for notifying completion of scan groups
	SgClient       am.ScanGroupService                // scangroup service connection
	AddressClient  am.AddressService                  // address service connection
	WebClient      am.WebDataService                  // webdata service connection
	ModuleClients  map[am.ModuleType]am.ModuleService // map of module service connections
	PortScanClient am.PortScannerService              // port scanner service
}

type DispatcherStatus

type DispatcherStatus int32

DispatcherStatus for determining if we are started/stopped

const (
	Unknown DispatcherStatus = 0
	Started DispatcherStatus = 1
	Stopped DispatcherStatus = 2
)

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for dispatching and handling responses from worker modules

func New

func New(services *DependentServices, stater state.Stater) *Service

New for dispatching groups to be analyzed to the modules

func (*Service) DecActiveAddresses

func (s *Service) DecActiveAddresses()

func (*Service) DecActiveGroups

func (s *Service) DecActiveGroups()

func (*Service) GetActiveAddresses

func (s *Service) GetActiveAddresses() int32

func (*Service) GetActiveGroups

func (s *Service) GetActiveGroups() int32

func (*Service) IncActiveAddresses

func (s *Service) IncActiveAddresses()

func (*Service) IncActiveGroups

func (s *Service) IncActiveGroups()

func (*Service) Init

func (s *Service) Init(config []byte) error

Init this dispatcher and register it with coordinator

func (*Service) PushAddresses

func (s *Service) PushAddresses(ctx context.Context, userContext am.UserContext, scanGroupID int) error

PushAddresses to state

func (*Service) ShouldPortScan

func (s *Service) ShouldPortScan(ctx context.Context, userContext am.UserContext, group *am.ScanGroup, address *am.ScanGroupAddress) (string, bool)

ShouldPortScan runs a number of checks to determine if we should / are allowed to port scan this address

func (*Service) StartGroupFilter

func (s *Service) StartGroupFilter(userContext am.UserContext, scanGroupID int, start time.Time) *am.ScanGroupAddressFilter

StartGroupFilter for building a filter for this scan group. Depending on subscription level we will only extract addresses that have not been scanned since: default: 30 min, small: 12 hours, medium: 6 hours.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) error

Stop the service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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