Documentation ¶
Index ¶
- func WithProofOfConceptEnabled(enabled bool) func(WithOptions)
- type Console
- func (c *Console) SetProofOfConcept(enabled bool)
- func (c *Console) WriteConfig(_ context.Context, cfg gbounty.Config) error
- func (c *Console) WriteError(_ context.Context, scanError gbounty.Error) error
- func (c *Console) WriteErrors(ctx context.Context, fs gbounty.FileSystem) error
- func (c *Console) WriteMatch(_ context.Context, m gbounty.Match, _ bool) error
- func (c *Console) WriteMatches(ctx context.Context, fs gbounty.FileSystem, _ bool) error
- func (c *Console) WriteMatchesSummary(ctx context.Context, fs gbounty.FileSystem) error
- func (c *Console) WriteStats(ctx context.Context, fs gbounty.FileSystem) error
- func (c *Console) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
- type JSON
- func (j JSON) WriteConfig(_ context.Context, cfg gbounty.Config) error
- func (j JSON) WriteError(_ context.Context, scanError gbounty.Error) error
- func (j JSON) WriteErrors(ctx context.Context, fs gbounty.FileSystem) error
- func (j JSON) WriteMatch(_ context.Context, m gbounty.Match, includeResponse bool) error
- func (j JSON) WriteMatches(ctx context.Context, fs gbounty.FileSystem, includeResponses bool) error
- func (j JSON) WriteMatchesSummary(ctx context.Context, fs gbounty.FileSystem) error
- func (j JSON) WriteStats(ctx context.Context, fs gbounty.FileSystem) error
- func (j JSON) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
- type Markdown
- func (md Markdown) WriteConfig(_ context.Context, cfg gbounty.Config) error
- func (md Markdown) WriteError(_ context.Context, scanError gbounty.Error) error
- func (md Markdown) WriteErrors(ctx context.Context, fs gbounty.FileSystem) error
- func (md Markdown) WriteMatch(_ context.Context, m gbounty.Match, includeResponse bool) error
- func (md Markdown) WriteMatches(ctx context.Context, fs gbounty.FileSystem, includeResponses bool) error
- func (md Markdown) WriteMatchesSummary(ctx context.Context, fs gbounty.FileSystem) error
- func (md Markdown) WriteStats(ctx context.Context, fs gbounty.FileSystem) error
- func (md Markdown) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
- type Option
- type Plain
- func (p *Plain) SetProofOfConcept(enabled bool)
- func (p *Plain) WriteConfig(_ context.Context, cfg gbounty.Config) error
- func (p *Plain) WriteError(_ context.Context, scanError gbounty.Error) error
- func (p *Plain) WriteErrors(ctx context.Context, fs gbounty.FileSystem) error
- func (p *Plain) WriteMatch(_ context.Context, m gbounty.Match, includeResponse bool) error
- func (p *Plain) WriteMatches(ctx context.Context, fs gbounty.FileSystem, includeResponses bool) error
- func (p *Plain) WriteMatchesSummary(ctx context.Context, fs gbounty.FileSystem) error
- func (p *Plain) WriteStats(ctx context.Context, fs gbounty.FileSystem) error
- func (p *Plain) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
- type WithOptions
- type WithProofOfConcept
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithProofOfConceptEnabled ¶
func WithProofOfConceptEnabled(enabled bool) func(WithOptions)
WithProofOfConceptEnabled is a [ConsoleOption] that enables the proof-of-concept mode. When enabled, the console will print the matches in a copy & paste friendlier format.
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console is a gbounty.Writer implementation that writes the output to the given io.Writer, following console/terminal standards in a human-friendly fashion.
func NewConsole ¶
NewConsole creates a new instance of Console with the given io.Writer.
func (*Console) SetProofOfConcept ¶
func (*Console) WriteConfig ¶
WriteConfig writes the gbounty.Config to the console.
func (*Console) WriteError ¶
WriteError writes the gbounty.Error to the console.
func (*Console) WriteErrors ¶
WriteErrors writes the gbounty.Error instances to the console.
func (*Console) WriteMatch ¶
WriteMatch writes the gbounty.Match to the console.
func (*Console) WriteMatches ¶
WriteMatches writes the gbounty.Match instances found during the scan, to the console.
func (*Console) WriteMatchesSummary ¶
WriteMatchesSummary writes a summary of the gbounty.Match instances found during the scan, to the console.
func (*Console) WriteStats ¶
WriteStats writes the gbounty.Stats to the console.
func (*Console) WriteTasks ¶
func (c *Console) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
WriteTasks writes the gbounty.TaskSummary instances to the console.
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
JSON is a gbounty.Writer implementation that writes the output to the given io.Writer, in a machine-readable format (JSON).
func (JSON) WriteConfig ¶
WriteConfig writes the gbounty.Config to the io.Writer as a JSON object.
func (JSON) WriteError ¶
WriteError writes a gbounty.Error to the io.Writer as a JSON object.
func (JSON) WriteErrors ¶
WriteErrors writes the gbounty.Error instances to the io.Writer as a JSON array of JSON objects.
func (JSON) WriteMatch ¶
WriteMatch writes a gbounty.Match to the io.Writer as a JSON object.
func (JSON) WriteMatches ¶
WriteMatches writes the gbounty.Match instances found during the [scan], as a JSON array of JSON objects.
func (JSON) WriteMatchesSummary ¶
WriteMatchesSummary writes a summary of the gbounty.Match instances found during the [scan], to the io.Writer as a JSON array of JSON objects.
func (JSON) WriteStats ¶
WriteStats writes the gbounty.Stats to the io.Writer as a JSON object.
func (JSON) WriteTasks ¶
func (j JSON) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
WriteTasks writes the gbounty.TaskSummary instances to the io.Writer as a JSON array of JSON objects.
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
Markdown is a gbounty.Writer implementation that writes the output to the given io.Writer, in a styled human-readable format (Markdown).
func NewMarkdown ¶
NewMarkdown creates a new instance of Markdown with the given io.Writer.
func (Markdown) WriteConfig ¶
WriteConfig writes the gbounty.Config to the io.Writer in the Markdown format.
func (Markdown) WriteError ¶
WriteError writes a gbounty.Error to the io.Writer in the Markdown format.
func (Markdown) WriteErrors ¶
WriteErrors writes the gbounty.Error instances to the io.Writer in the Markdown format.
func (Markdown) WriteMatch ¶
WriteMatch writes a gbounty.Match to the io.Writer in the Markdown format.
func (Markdown) WriteMatches ¶
func (md Markdown) WriteMatches(ctx context.Context, fs gbounty.FileSystem, includeResponses bool) error
WriteMatches writes the gbounty.Match instances found during the [scan], in the Markdown format.
func (Markdown) WriteMatchesSummary ¶
WriteMatchesSummary writes a summary of the gbounty.Match instances found during the [scan], to the io.Writer in the Markdown format.
func (Markdown) WriteStats ¶
WriteStats writes the gbounty.Stats to the io.Writer in the Markdown format.
func (Markdown) WriteTasks ¶
func (md Markdown) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
WriteTasks writes the gbounty.TaskSummary instances to the io.Writer in the Markdown format.
type Option ¶
type Option func(WithOptions)
Option is a function that can be used to configure a WithOptions implementation.
type Plain ¶
type Plain struct {
// contains filtered or unexported fields
}
Plain is a gbounty.Writer implementation that writes the output to the given io.Writer, as plain text. The format is quite similar to Console but without colors.
func (*Plain) SetProofOfConcept ¶
func (*Plain) WriteConfig ¶
WriteConfig writes the gbounty.Config to the io.Writer as plain text.
func (*Plain) WriteError ¶
WriteError writes a gbounty.Error to the io.Writer as plain text.
func (*Plain) WriteErrors ¶
WriteErrors writes the gbounty.Error instances to the io.Writer as plain text.
func (*Plain) WriteMatch ¶
WriteMatch writes a gbounty.Match to the io.Writer as plain text.
func (*Plain) WriteMatches ¶
func (p *Plain) WriteMatches(ctx context.Context, fs gbounty.FileSystem, includeResponses bool) error
WriteMatches writes the gbounty.Match instances found during the [scan], as plain text.
func (*Plain) WriteMatchesSummary ¶
WriteMatchesSummary writes a summary of the gbounty.Match instances found during the [scan], to the io.Writer as plain text.
func (*Plain) WriteStats ¶
WriteStats writes the gbounty.Stats to the io.Writer as plain text.
func (*Plain) WriteTasks ¶
func (p *Plain) WriteTasks(ctx context.Context, fs gbounty.FileSystem, allRequests, allResponses bool) error
WriteTasks writes the gbounty.TaskSummary instances to the io.Writer as plain text.
type WithOptions ¶
type WithOptions interface { WithProofOfConcept }
WithOptions is an interface that defines the expected behavior for gbounty.Writer implementations on this package that can be configured with Option. It's mostly a composition of all the concrete interfaces.
type WithProofOfConcept ¶
type WithProofOfConcept interface {
SetProofOfConcept(enabled bool)
}
WithProofOfConcept is an interface that defines the expected behavior for gbounty.Writer implementations on this package that can be configured with WithProofOfConceptEnabled.