coordinator

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrScanGroupPaused         = errors.New("scan group is currently paused")
	ErrScanGroupAlreadyStarted = errors.New("scan group is already running")
	ErrNoDispatcherConnected   = errors.New("service unavailable, no dispatchers connected")
)

Functions

This section is empty.

Types

type Service

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

Service for coordinating all scans

func New

func New(state state.Stater, dispatcherClient am.DispatcherService, orgClient am.OrganizationService, scanGroupClient am.ScanGroupService, systemOrgID, systemUserID int) *Service

New returns

func (*Service) Init

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

Init by

func (*Service) StartGroup

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

StartGroup initializes state system if they do not exist, or updates with scan group details

func (*Service) StopGroup

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

StopGroup checks the group status in our state system. If it's already stopped, we are done. Otherwise, it extracts group from scangroup client to create a proxyUserContext.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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