MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / ensureMaxArgs

Method ensureMaxArgs

options/parser/parse.go:20–30  ·  view source on GitHub ↗

ensureMaxArgs checks if the number of arguments is as expected

(
	ctx context.Context,
	name string,
	args []string,
	maxArgs int,
)

Source from the content-addressed store, hash-verified

18
19// ensureMaxArgs checks if the number of arguments is as expected
20func (p *Parser) ensureMaxArgs(
21 ctx context.Context,
22 name string,
23 args []string,
24 maxArgs int,
25) error {
26 if len(args) > maxArgs {
27 return newInvalidArgsError(ctx, name, args)
28 }
29 return nil
30}
31
32// parseBool parses a boolean option value and warns if the value is invalid
33func (p *Parser) parseBool(

Callers 15

applySizeOptionMethod · 0.95
applyResizeOptionMethod · 0.95
applyZoomOptionMethod · 0.95
applyPaddingOptionMethod · 0.95
applyTrimOptionMethod · 0.95
applyFlipOptionMethod · 0.95
applyWatermarkOptionMethod · 0.95
applyFormatOptionMethod · 0.95
applyFilenameOptionMethod · 0.95
applyExpiresOptionMethod · 0.95
parseBoolMethod · 0.95

Calls 1

newInvalidArgsErrorFunction · 0.85

Tested by

no test coverage detected