mns

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderMNSPrefix = "x-mns-"
View Source
const (
	MNSAPIVersion = "2015-06-06"
)

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 Md5

func Md5(byteMessage []byte) string

对数据进行md5计算

func Sha1

func Sha1(data string) string

对字符串进行sha1 计算

Types

type Client

type Client struct {
	AccessKeyId     string
	AccessKeySecret string
	Endpoint        string
	Version         string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(accessKeyId, accessKeySecret, endpoint string) (client *Client)

func (*Client) SignRequest

func (client *Client) SignRequest(req *request, payload []byte)

授权签名

type Error

type Error struct {
	StatusCode int
	Code       string `xml:"Code"`
	Message    string `xml:"Message"`
}

func (*Error) Error

func (err *Error) Error() string

type Message

type Message struct {
	MessageBody string `xml:"MessageBody"`
}

type MsgReceive

type MsgReceive struct {
	MessageId       string `xml:"MessageId"`
	MessageBodyMD5  string `xml:"MessageBodyMD5"`
	MessageBody     string `xml:"MessageBody"`
	ReceiptHandle   string `xml:"ReceiptHandle"`
	EnqueueTime     int64  `xml:"EnqueueTime"`
	NextVisibleTime int64  `xml:"NextVisibleTime"`
	DequeueCount    int    `xml:"DequeueCount"`
	Priority        int    `xml:"Priority"`
}

type MsgSend

type MsgSend struct {
	MessageId      string `xml:"MessageId"`
	MessageBodyMD5 string `xml:"MessageBodyMD5"`
}

type Queue

type Queue struct {
	*Client
	QueueName string
	Base64    bool
}

func (*Queue) Delete

func (queue *Queue) Delete(receiptHandle string, errChan chan error)

删除队列消息

func (*Queue) Receive

func (queue *Queue) Receive(messageChan chan MsgReceive, errChan chan error)

消费队列消息

func (*Queue) Send

func (queue *Queue) Send(time int64, message []byte) (msg MsgSend, err error)

发送队列消息

Jump to

Keyboard shortcuts

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