-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: updating binary to support non-zero status codes and environ…
…ment variables
- Loading branch information
Showing
10 changed files
with
168 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package models | ||
|
||
import ( | ||
"go.k6.io/k6/output" | ||
) | ||
|
||
var ( | ||
ENV_SERVER_URL = "XK6_TRACETEST_SERVER_URL" | ||
ENV_SERVER_PATH = "XK6_TRACETEST_SERVER_PATH" | ||
) | ||
|
||
type OutputConfig struct { | ||
ServerUrl string | ||
ServerPath string | ||
} | ||
|
||
func NewConfig(params output.Params) (OutputConfig, error) { | ||
cfg := OutputConfig{ | ||
ServerUrl: ServerURL, | ||
ServerPath: ServerPath, | ||
} | ||
|
||
if params.ConfigArgument != "" { | ||
cfg.ServerUrl = params.ConfigArgument | ||
} else if val, ok := params.Environment[ENV_SERVER_URL]; ok { | ||
cfg.ServerUrl = val | ||
} | ||
|
||
if val, ok := params.Environment[ENV_SERVER_PATH]; ok { | ||
cfg.ServerPath = val | ||
} | ||
|
||
return cfg, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.