jsonmessage

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2017 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package jsonmessage is a stripped down version of github.com/docker/docker/pkg/jsonmessage without any transitive dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONError

type JSONError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

JSONError wraps a concrete Code and Message, `Code` is is a integer error code, `Message` is the error message.

func (*JSONError) Error

func (e *JSONError) Error() string

type JSONMessage

type JSONMessage struct {
	Status       string     `json:"status,omitempty"`
	Error        *JSONError `json:"errorDetail,omitempty"`
	ErrorMessage string     `json:"error,omitempty"` //deprecated
}

func NewError

func NewError(err error) JSONMessage

type Stream

type Stream struct {
	io.Writer
	// contains filtered or unexported fields
}

Stream provides a simple wrapper around an io.Writer to write jsonmessage's to it.

func NewStream

func NewStream(w io.Writer) *Stream

NewStream returns a new Stream backed by w.

func (*Stream) Encode

func (w *Stream) Encode(m JSONMessage) error

Encode encodes m into the stream and implements the jsonmessage.Writer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL