updating with base branch

This commit is contained in:
Julien Neuhart
2019-12-10 15:17:25 +01:00
47 changed files with 1728 additions and 594 deletions

View File

@@ -54,6 +54,9 @@ const (
// PageRangesArgKey is the key
// of the argument "pageRanges".
PageRangesArgKey ArgKey = "pageRanges"
// GoogleChromeRpccBufferSizeArgKey is the key
// of the argument "googleChromeRpccBufferSize".
GoogleChromeRpccBufferSizeArgKey ArgKey = "googleChromeRpccBufferSize"
)
/*
@@ -77,6 +80,7 @@ func ArgKeys() []ArgKey {
MarginRightArgKey,
LandscapeArgKey,
PageRangesArgKey,
GoogleChromeRpccBufferSizeArgKey,
}
}
@@ -269,3 +273,24 @@ func MarginArgs(r Resource, config conf.Config) (float64, float64, float64, floa
marginRight,
nil
}
/*
GoogleChromeRpccBufferSizeArg is a helper for retrieving
the "googleChromeRpccBufferSize" argument as int64.
It also validates it against the application
configuration.
*/
func GoogleChromeRpccBufferSizeArg(r Resource, config conf.Config) (int64, error) {
const op string = "resource.GoogleChromeRpccBufferSizeArg"
result, err := r.Int64Arg(
GoogleChromeRpccBufferSizeArgKey,
config.DefaultGoogleChromeRpccBufferSize(),
xassert.Int64NotInferiorTo(0.0),
xassert.Int64NotSuperiorTo(config.MaximumGoogleChromeRpccBufferSize()),
)
if err != nil {
return result, xerror.New(op, err)
}
return result, nil
}