{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package jsonmessage\n\n## Functions\n\n```go\nfunc DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(*json.RawMessage)) error\n```\nDisplayJSONMessagesStream displays a json message stream from \\`in\\` to \\`out\\`, \\`isTerminal\\` describes if \\`out\\` is a terminal. If this is the case, it will print \\`\\\\n\\` at the end of each line and move the cursor while displaying.\n\n## Types\n\n```go\ntype JSONError struct {\n\tCode    int    `json:\"code,omitempty\"`\n\tMessage string `json:\"message,omitempty\"`\n}\n```\nJSONError wraps a concrete Code and Message, \\`Code\\` is is a integer error code, \\`Message\\` is the error message.\n\n```go\nfunc (e *JSONError) Error() string\n```\n\n```go\ntype JSONMessage struct {\n\tStream          string        `json:\"stream,omitempty\"`\n\tStatus          string        `json:\"status,omitempty\"`\n\tProgress        *JSONProgress `json:\"progressDetail,omitempty\"`\n\tProgressMessage string        `json:\"progress,omitempty\"` //deprecated\n\tID              string        `json:\"id,omitempty\"`\n\tFrom            string        `json:\"from,omitempty\"`\n\tTime            int64         `json:\"time,omitempty\"`\n\tTimeNano        int64         `json:\"timeNano,omitempty\"`\n\tError           *JSONError    `json:\"errorDetail,omitempty\"`\n\tErrorMessage    string        `json:\"error,omitempty\"` //deprecated\n\t// Aux contains out-of-band data, such as digests for push signing.\n\tAux *json.RawMessage `json:\"aux,omitempty\"`\n}\n```\nJSONMessage defines a message struct. It describes the created time, where it from, status, ID of the message. It's used for docker events.\n\n```go\nfunc (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error\n```\nDisplay displays the JSONMessage to \\`out\\`. \\`isTerminal\\` describes if \\`out\\` is a terminal. If this is the case, it will erase the entire current line when displaying the progressbar.\n\n```go\ntype JSONProgress struct {\n\tCurrent int64 `json:\"current,omitempty\"`\n\tTotal   int64 `json:\"total,omitempty\"`\n\tStart   int64 `json:\"start,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nJSONProgress describes a Progress. terminalFd is the fd of the current terminal, Start is the initial value for the operation. Current is the current status and value of the progress made towards Total. Total is the end value describing when we made 100% progress for an operation.\n\n```go\nfunc (p *JSONProgress) String() string\n```\n\n","path":"github.com/hyperhq/hypercli/pkg/jsonmessage","name":"jsonmessage","synopsis":"","isRedistributable":true}
