Documentation ¶
Index ¶
- Constants
- type Afero
- func (a *Afero) Cleanup(ctx context.Context) error
- func (a *Afero) ErrorsIterator(ctx context.Context) (chan scan.Error, scan.CloseFunc, error)
- func (a *Afero) LoadErrors(ctx context.Context) ([]scan.Error, error)
- func (a *Afero) LoadMatches(ctx context.Context) ([]scan.Match, error)
- func (a *Afero) LoadStats(ctx context.Context) (*scan.Stats, error)
- func (a *Afero) LoadTasksSummaries(ctx context.Context) ([]scan.TaskSummary, error)
- func (a *Afero) LoadTemplates(ctx context.Context) ([]scan.Template, error)
- func (a *Afero) MatchesIterator(ctx context.Context) (chan scan.Match, scan.CloseFunc, error)
- func (a *Afero) StoreError(ctx context.Context, scanError scan.Error) error
- func (a *Afero) StoreMatch(ctx context.Context, scanMatch scan.Match) error
- func (a *Afero) StoreStats(ctx context.Context, stats *scan.Stats) error
- func (a *Afero) StoreTaskSummary(ctx context.Context, scanTaskSummary scan.TaskSummary) error
- func (a *Afero) StoreTemplate(ctx context.Context, scanTemplate scan.Template) error
- func (a *Afero) TasksSummariesIterator(ctx context.Context) (chan scan.TaskSummary, scan.CloseFunc, error)
- func (a *Afero) TemplatesIterator(ctx context.Context) (chan scan.Template, error)
Constants ¶
const ( // FileStats is the name of the file where the scan stats are saved to. FileStats = "stats.json" // FileErrors is the name of the file where the scan errors are saved to. FileErrors = "errors.json" // FileMatches is the name of the file where the scan matches are saved to. FileMatches = "matches.json" // FileTasks is the name of the file where the scan tasks are saved to. FileTasks = "tasks.json" // FileTemplates is the name of the file where the scan templates are saved to. FileTemplates = "templates.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Afero ¶
type Afero struct {
// contains filtered or unexported fields
}
Afero is a scan.FileSystem implementation that uses the afero.Fs interface under the hood. So, it can rely on the afero package abstractions to either use a regular (disk-based) file-system, or a virtual one (like in-memory).
func (*Afero) ErrorsIterator ¶
ErrorsIterator returns a channel that iterates over the scan.Error instances.
It also returns a function that can be used to close the iterator (see scan.CloseFunc). The channel is closed when the iterator is done (no more elements), when the scan.CloseFunc is called, or when the context is canceled. Thus, the context cancellation can also be used to stop the iteration.
It is the "streaming fashion" equivalent of [LoadErrors()].
func (*Afero) LoadErrors ¶
LoadErrors loads the scan.Error instances from the file system.
func (*Afero) LoadMatches ¶
LoadMatches loads the scan.Match instances from the file system.
func (*Afero) LoadStats ¶
LoadStats loads the scan.Stats from the file system.
func (*Afero) LoadTasksSummaries ¶
LoadTasksSummaries loads the scan.TaskSummary instances from the file system.
func (*Afero) LoadTemplates ¶
LoadTemplates loads the scan.Template instances from the file system.
func (*Afero) MatchesIterator ¶
MatchesIterator returns a channel that iterates over the scan.Match instances.
It also returns a function that can be used to close the iterator (see scan.CloseFunc). The channel is closed when the iterator is done (no more elements), when the scan.CloseFunc is called, or when the context is canceled. Thus, the context cancellation can also be used to stop the iteration.
It is the "streaming fashion" equivalent of [LoadMatches()].
func (*Afero) StoreError ¶
StoreError stores the given scan.Error into the file system.
func (*Afero) StoreMatch ¶
StoreMatch stores the given scan.Match into the file system.
func (*Afero) StoreStats ¶
StoreStats stores the given scan.Stats into the file system.
func (*Afero) StoreTaskSummary ¶
StoreTaskSummary stores the given scan.TaskSummary into the file system.
func (*Afero) StoreTemplate ¶
StoreTemplate stores the given scan.Template into the file system.
func (*Afero) TasksSummariesIterator ¶
func (a *Afero) TasksSummariesIterator(ctx context.Context) (chan scan.TaskSummary, scan.CloseFunc, error)
TasksSummariesIterator returns a channel that iterates over the scan.TaskSummary instances.
It also returns a function that can be used to close the iterator (see scan.CloseFunc). The channel is closed when the iterator is done (no more elements), when the scan.CloseFunc is called, or when the context is canceled. Thus, the context cancellation can also be used to stop the iteration.
It is the "streaming fashion" equivalent of [LoadTasksSummaries()].
func (*Afero) TemplatesIterator ¶
TemplatesIterator returns a channel that iterates over the scan.Template instances.
It also returns a function that can be used to close the iterator (see scan.CloseFunc). The channel is closed when the iterator is done (no more elements), when the scan.CloseFunc is called, or when the context is canceled. Thus, the context cancellation can also be used to stop the iteration.
It is the "streaming fashion" equivalent of [LoadTemplates()].