outputmanager¶
import "github.com/HexmosTech/lama2/outputManager"
Package `outputmanager` provides facilities for controlling the logging library as well as capabilities to post-process API execution results (such as store results as a JSON file)
Index¶
- Variables
- func ConfigureZeroLog(level string)
- func DisableLogBuff()
- func ResponseToJSON(resp httpie.ExResponse, responseTimes []ResponseTime, statusCode []StatusCode, contentSizes []ContentSize) (*gabs.Container, error)
- func WriteJSONOutput(resp httpie.ExResponse, targetPath string, responseTime []ResponseTime, statusCodes []StatusCode, contentSizes []ContentSize)
- type ContentSize
- type ResponseTime
- type StatusCode
Variables¶
LogBuff is used to append various log statements into memory. If the user toggles the `Output (-o)` option, then the contents of LogBuff is pushed into a JSON file
var LogBuff bytes.Buffer
func ConfigureZeroLog¶
func ConfigureZeroLog(level string)
ConfigureZeroLog provides global log level setting. By default, ZeroLog uses the DEBUG level; however, the function makes the desired level more explicit
func DisableLogBuff¶
func DisableLogBuff()
func ResponseToJSON¶
func ResponseToJSON(resp httpie.ExResponse, responseTimes []ResponseTime, statusCode []StatusCode, contentSizes []ContentSize) (*gabs.Container, error)
func WriteJSONOutput¶
func WriteJSONOutput(resp httpie.ExResponse, targetPath string, responseTime []ResponseTime, statusCodes []StatusCode, contentSizes []ContentSize)
WriteJSONOutput is primarily built for helping with Extension/Integration building with external tools. Extension writers may simply call `l2 -n -o /tmp/lama2.json ...` to invoke WriteJSONOutput; the generated json file contains three keys: `logs`, `headers`, `body`
type ContentSize¶
type ContentSize struct {
Type string `json:"type"`
SizeInBytes int `json:"sizeInBytes"`
}
type ResponseTime¶
type ResponseTime struct {
Type string `json:"type"`
TimeInMs int64 `json:"timeInMs"`
}
type StatusCode¶
type StatusCode struct {
Type string `json:"type"`
Status int `json:"statusCode"`
}
Generated by gomarkdoc