mq2http

package module
v0.0.0-...-b6dc446 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

README

mq2http

AMQP-to-HTTP-to-AMQP Libary in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(rw RequestWriter) (*http.Request, error)

NewRequest is ...

func NewResponse

func NewResponse(rw ResponseWriter) (*http.Response, error)

NewResponse is ...

Types

type AMQPRPCSettings

type AMQPRPCSettings struct {
	Exchange     string
	ExchangeType string
	BindingKey   string
	ConsumerTag  string
}

AMQPRPCSettings is ...

type AMQPWriter

type AMQPWriter struct {
	ReplyTo       string
	CorrelationID string
	Exchange      string
	ExchangeType  string
	AMQPConn      *samqp.Connection
	Headers       map[string][]string
	Status        int
}

AMQPWriter is ...

func AMQPFactory

func AMQPFactory(ReplyTo, Exchange, ExchangeType, CorrelationID string, AMQPConn *samqp.Connection) (AMQPWriter, error)

AMQPFactory is ...

func (AMQPWriter) Header

func (w AMQPWriter) Header() http.Header

Header is ...

func (AMQPWriter) Write

func (w AMQPWriter) Write(body []byte) (int, error)

Write is ...

func (AMQPWriter) WriteHeader

func (w AMQPWriter) WriteHeader(status int)

WriteHeader is ...

type JSONRPCRequest

type JSONRPCRequest struct {
	Version string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  ReqParamsStruct `json:"params,omitempty"`
	ID      string          `json:"id,omitempty"`
}

JSONRPCRequest is ...

type JSONRPCRequestReader

type JSONRPCRequestReader struct {
	// contains filtered or unexported fields
}

JSONRPCRequestReader is ...

func NewJSONRPCRequestReader

func NewJSONRPCRequestReader(b []byte) (*JSONRPCRequestReader, error)

NewJSONRPCRequestReader is ...

func (*JSONRPCRequestReader) Headers

func (j *JSONRPCRequestReader) Headers() http.Header

Headers is ...

func (*JSONRPCRequestReader) Method

func (j *JSONRPCRequestReader) Method() string

Method is ...

func (*JSONRPCRequestReader) Reader

func (j *JSONRPCRequestReader) Reader() io.Reader

Reader is ...

func (*JSONRPCRequestReader) URL

func (j *JSONRPCRequestReader) URL() string

URL is ...

type JSONRPCResponse

type JSONRPCResponse struct {
	Version string           `json:"jsonrpc"`
	Result  RespParamsStruct `json:"result,omitempty"`
	Error   string           `json:"error,omitempty"`
	ID      string           `json:"id,emitempty"`
}

JSONRPCResponse is ...

type JSONRPCResponseReader

type JSONRPCResponseReader struct {
	// contains filtered or unexported fields
}

JSONRPCResponseReader is ...

func NewJSONRPCResponseReader

func NewJSONRPCResponseReader(b []byte) (*JSONRPCResponseReader, error)

NewJSONRPCResponseReader is ...

func (*JSONRPCResponseReader) ContentLength

func (j *JSONRPCResponseReader) ContentLength() int64

ContentLength is ...

func (*JSONRPCResponseReader) Headers

func (j *JSONRPCResponseReader) Headers() http.Header

Headers is ...

func (*JSONRPCResponseReader) Reader

func (j *JSONRPCResponseReader) Reader() io.ReadCloser

Reader is ...

func (*JSONRPCResponseReader) Status

func (j *JSONRPCResponseReader) Status() string

Status is ...

func (*JSONRPCResponseReader) StatusCode

func (j *JSONRPCResponseReader) StatusCode() int

StatusCode is ...

type ReqParamsStruct

type ReqParamsStruct struct {
	Body    string      `json:"body"`
	Headers http.Header `json:"headers"`
}

ReqParamsStruct is ...

type RequestWriter

type RequestWriter interface {
	Headers() http.Header
	Method() string
	URL() string
	Reader() io.Reader
}

RequestWriter is ...

type RespParamsStruct

type RespParamsStruct struct {
	Status     string `json:"status"` // Have this in resp
	StatusCode int    `json:"statuscode"`
	// Proto string
	// ProtoMajor int
	// ProtoMinor int
	Header        http.Header `json:"header"` // have this in amqp.go mq2http
	Body          string      `json:"body"`
	ContentLength int64       `json:"contentlength"` // = len(body)
	//	TransferEncoding []string
	Close        bool `json:"close"`        // always false
	Uncompressed bool `json:"uncompressed"` // always true
	// 	Trailer      http.Header          `json:"trailer"`      // same as headers
	Request *http.Request `json:"reqpest"` // nil

}

RespParamsStruct is ....

type ResponseWriter

type ResponseWriter interface {
	Status() string
	StatusCode() int
	Headers() http.Header
	Reader() io.ReadCloser
	ContentLength() int64
}

ResponseWriter is ...

Jump to

Keyboard shortcuts

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