-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #3
Conversation
ViaoV
commented
Aug 13, 2017
- Fake data expansion
- hammer command
- refactored explorer commands
- refactored scripting objects
Empty configuration files would cause a config error. It now will quietly load the default configuration. Fixed an issue with lower case method names Request methods are now converted to uppercase from the endpoint configuration. End to end testing for request module The request module now has tests end to end. This packages tests act as a kind of integration test.
Changes the objects exposed to scripts. $payload has been removed. It's functionality is now in $response.body and $request.setBody(). $headers has been removed. It's functionality is now in $request.headers.get(), $request.headers.set(), $response.headers.get()
Explorer commands now match the script commands Auto display request data on request Request data and payload are now automatically displayed when the request is ran. Corrected several issues with the JSON highlighting.
Added fake data expansion to URLs, query params, and request data. Fake data can be inserted by using a '#{key}' template variable in any field value.
The hammer command will execute an endpoint request multiple times and report back overall details about the requests.
* Added TravisCI integration * Added README * Variable Expansion in Endpoint Configurations Config objects themselves support performing expanding strings containing variables. This was implemented in the endpoint configuration. Variables can now be used in request data, query params, headers, request method, and in the URL. If the variable exists in either configuration it will be expanded to its value.
Empty configuration files would cause a config error. It now will quietly load the default configuration. Fixed an issue with lower case method names Request methods are now converted to uppercase from the endpoint configuration. End to end testing for request module The request module now has tests end to end. This packages tests act as a kind of integration test.
* Added TravisCI integration * Added README * Variable Expansion in Endpoint Configurations Config objects themselves support performing expanding strings containing variables. This was implemented in the endpoint configuration. Variables can now be used in request data, query params, headers, request method, and in the URL. If the variable exists in either configuration it will be expanded to its value.
Empty configuration files would cause a config error. It now will quietly load the default configuration. Fixed an issue with lower case method names Request methods are now converted to uppercase from the endpoint configuration. End to end testing for request module The request module now has tests end to end. This packages tests act as a kind of integration test.
* Added TravisCI integration * Added README * Variable Expansion in Endpoint Configurations Config objects themselves support performing expanding strings containing variables. This was implemented in the endpoint configuration. Variables can now be used in request data, query params, headers, request method, and in the URL. If the variable exists in either configuration it will be expanded to its value.
Empty configuration files would cause a config error. It now will quietly load the default configuration. Fixed an issue with lower case method names Request methods are now converted to uppercase from the endpoint configuration. End to end testing for request module The request module now has tests end to end. This packages tests act as a kind of integration test.
* Added TravisCI integration * Added README * Variable Expansion in Endpoint Configurations Config objects themselves support performing expanding strings containing variables. This was implemented in the endpoint configuration. Variables can now be used in request data, query params, headers, request method, and in the URL. If the variable exists in either configuration it will be expanded to its value.
request/response.go
Outdated
) | ||
|
||
type ( | ||
Response struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type Response should have comment or be unexported
request/request.go
Outdated
err := scriptEngine.ExecuteFile(scriptPath) | ||
if err != nil { | ||
return res, err | ||
return res, errors.New(fmt.Sprintf("Error parsing script (%s): %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
request/request.go
Outdated
) | ||
|
||
func Do(config *endpoint.EndpointConfig) (*Response, error) { | ||
func Do(epConfig *endpoint.EndpointConfig) (*Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function Do should have comment or be unexported
return otto.Value{} | ||
} | ||
|
||
// getResHeader - Returns a header from the response. | ||
func (engine *ScriptEngine) getResHeader(call otto.FunctionCall) otto.Value { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receiver name engine should be consistent with previous receiver name eng for ScriptEngine
// setHeader - sets a header on the request. | ||
func (engine *ScriptEngine) setHeader(call otto.FunctionCall) otto.Value { | ||
// setReqHeader - sets a header on the request. | ||
func (engine *ScriptEngine) setReqHeader(call otto.FunctionCall) otto.Value { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receiver name engine should be consistent with previous receiver name eng for ScriptEngine
output/progress.go
Outdated
} | ||
} | ||
|
||
func (bar *ProgressBar) Stop() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ProgressBar.Stop should have comment or be unexported
output/progress.go
Outdated
} | ||
} | ||
|
||
func (bar *ProgressBar) Inc() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ProgressBar.Inc should have comment or be unexported
output/progress.go
Outdated
startTime time.Time | ||
} | ||
|
||
func NewProgress(max int) *ProgressBar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewProgress should have comment or be unexported
output/progress.go
Outdated
"time" | ||
) | ||
|
||
type ProgressBar struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type ProgressBar should have comment or be unexported
} | ||
) | ||
|
||
func New() *EndpointConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function New should have comment or be unexported
} | ||
|
||
//Execute - Executes a Javascript. | ||
func (eng *ScriptEngine) Execute(script string) error { | ||
func (engine *ScriptEngine) Execute(script string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receiver name engine should be consistent with previous receiver name eng for ScriptEngine