mq

package
v0.0.0-...-f8f9ceb Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentMillisecond

func GetCurrentMillisecond() int64

获取当前时间戳(毫秒)

func GetCurrentUnixMicro

func GetCurrentUnixMicro() int64

获取当前时间戳(秒)

func HamSha1

func HamSha1(data string, key []byte) string

func HttpDelete

func HttpDelete(urlStr string, header map[string]string) ([]byte, int, error)

GET请求

func HttpGet

func HttpGet(urlStr string, header map[string]string) ([]byte, int, error)

GET请求

func Md5

func Md5(byteMessage []byte) string

对数据进行md5计算

func Sha1

func Sha1(data string) string

对字符串进行sha1 计算

Types

type Client

type Client struct {
	AccessKey  string
	SecretKey  string
	Endpoint   string
	Topic      string
	ProducerId string
	ConsumerId string
	Key        string
	Tag        string
}

func NewClient

func NewClient(ak string, sk string, endpoint string, topic string,
	producerId string, consumerId string, key string, tag string) (client *Client)

func (*Client) ReceiveMessage

func (client *Client) ReceiveMessage(messageChan chan string, errChan chan error)

func (*Client) Send

func (client *Client) Send(time int64, message []byte) (msgId string, err error)

type Message

type Message struct {
	Body           string `json:"body"`
	BornTime       string `json:"bornTime"`
	Key            string `json:"key"`
	MsgHandle      string `json:"msgHandle"`
	MsgId          string `json:"msgId"`
	ReconsumeTimes int    `json:"reconsumeTimes"`
	Tag            string `json:"tag"`
}

type MessageResponse

type MessageResponse struct {
	Body     string `json:"body"`
	BornTime int64  `json:"bornTime"` // UTC time in Unix
}

type Messages

type Messages struct {
	Topic      string
	Tag        string
	ConsumerId string
	Time       int64
}

type SendMessage

type SendMessage struct {
	Topic      string
	Tag        string
	ProducerId string
	Key        string
	Body       string
	Time       int64
}

Jump to

Keyboard shortcuts

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