serverlog

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drain

func Drain(in io.Reader, out io.Writer, result interface{}) (err error)

func NewLogWriter

func NewLogWriter(out io.Writer) io.Writer

func SendError

func SendError(w io.Writer, err error) error

func SendObject

func SendObject(w io.Writer, obj interface{}) error

Types

type ServerError

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

ServerError describes the error that occurred in server. `Code` is a integer error code, `Message` is the error message.

func (*ServerError) Error

func (e *ServerError) Error() string

type ServerLog

type ServerLog struct {
	Message string       `json:"msg,omitempty"`
	Error   *ServerError `json:"err,omitempty"`
	Object  interface{}  `json:"obj,omitempty"`
}

ServerLog describes log messages generated from server and should display in client. It also contains a error message to indicate server failure.

Jump to

Keyboard shortcuts

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