Skip to content

Implement in-cluster analysers as structs with an API contract (interface) #995

@banjoh

Description

@banjoh

Describe the rationale for the suggested feature.

In cluster analysers, as opposed to all other constructs (collectors, host analysers) in the project are implemented in a functional manner rather than in an OOP manner. This makes it harder to work with them cause there is no API contract. We cannot for example query the analyser name using a function such as analyser.Title()

Describe the feature

Modify all in-cluster analysers to have them implement the interface below

type Analyzer interface {
	Title() string
	IsExcluded() (bool, error)
	Analyze(getFile func(string) ([]byte, error)) ([]*AnalyzeResult, error)
}

This follows how host analysers have been implemented.

Describe alternatives you've considered

Leave things as they are

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions