proto

package
v0.0.0-...-d5cfa09 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyBody = errors.New("empty body")
)

Functions

This section is empty.

Types

type Message

type Message struct {
	Header      MessageHeader `json:"header"`
	Payload     interface{}   `json:"payload"`
	PayloadJSON gjson.Result  `json:"-"`
	Attach      io.ReadCloser `json:"-"`
}

func NewMessage

func NewMessage(name string, payload interface{}) *Message

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(b []byte) error

type MessageHeader

type MessageHeader struct {
	Namespace       string `json:"namespace"`
	Name            string `json:"name"`
	MessageId       string `json:"messageId"`
	DialogRequestId string `json:"dialogRequestId"`
}

type ResponseReader

type ResponseReader struct {
	*http.Response
	// contains filtered or unexported fields
}

func NewResponseReader

func NewResponseReader(resp *http.Response) (*ResponseReader, error)

func (*ResponseReader) Close

func (r *ResponseReader) Close() error

func (*ResponseReader) ReadAttach

func (r *ResponseReader) ReadAttach() (io.ReadCloser, error)

func (*ResponseReader) ReadDirective

func (r *ResponseReader) ReadDirective() (*Message, error)

func (*ResponseReader) ReadJSON

func (r *ResponseReader) ReadJSON() (*gjson.Result, error)

Jump to

Keyboard shortcuts

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