server

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Analyzers []lookout.AnalyzerConfig
}

Config is a server configuration

type LogPoster added in v0.1.4

type LogPoster struct {
	Log log.Logger
}

func (*LogPoster) Post added in v0.1.4

func (p *LogPoster) Post(ctx context.Context, e lookout.Event,
	aCommentsList []lookout.AnalyzerComments, safe bool) error

func (*LogPoster) Status added in v0.1.4

func (p *LogPoster) Status(ctx context.Context, e lookout.Event,
	status lookout.AnalysisStatus) error

type Options added in v0.8.0

type Options struct {
	Poster     lookout.Poster
	FileGetter lookout.FileGetter
	Analyzers  map[string]lookout.Analyzer

	// EventOp is the operator for the Event persistence. Can be left unset.
	EventOp store.EventOperator
	// CommentOp is the operator for the Comment persistence. Can be left unset.
	CommentOp store.CommentOperator
	// OrganizationOp is the operator for the Organization persistence. Can be left unset.
	OrganizationOp store.OrganizationOperator

	// ReviewTimeout is the timeout for an analyzer to reply a NotifyReviewEvent.
	// Zero means no timeout.
	ReviewTimeout time.Duration
	// PushTimeout is the timeout for an analyzer to reply a NotifyPushEvent.
	// Zero means no timeout.
	PushTimeout time.Duration

	// ExitOnError set to true will stop the server and return an error
	// if any analyzer Notify* call or a posting call fails
	ExitOnError bool
}

Options defines the options for NewServer

type Server

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

Server implements glue between providers / data-server / analyzers

func NewServer

func NewServer(opt Options) *Server

NewServer creates a new Server with the given options

func (*Server) HandleEvent added in v0.3.0

func (s *Server) HandleEvent(ctx context.Context, e lookout.Event) error

HandleEvent processes the event calling the analyzers, and posting the results

func (*Server) HandlePush

func (s *Server) HandlePush(ctx context.Context, e *lookout.PushEvent, safePosting bool) error

HandlePush sends request to analyzers concurrently

func (*Server) HandleReview

func (s *Server) HandleReview(ctx context.Context, e *lookout.ReviewEvent, safePosting bool) error

HandleReview sends request to analyzers concurrently

Jump to

Keyboard shortcuts

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