mns

package
v0.0.0-...-766f525 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 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
	SecurityToken   string
	// contains filtered or unexported fields
}

func NewClient

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

func NewClientWithSecurityToken

func NewClientWithSecurityToken(accessKeyId, accessKeySecret, endpoint string, securityToken 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 MsgReceives

type MsgReceives struct {
	Message []*MsgReceive `xml:"Message"`
}

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) DeleteBatch

func (queue *Queue) DeleteBatch(errChan chan error, receiptHandles ...string)

删除队列消息

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)

发送队列消息

type ReceiptHandles

type ReceiptHandles struct {
	XMLName        xml.Name `xml:"ReceiptHandles"`
	ReceiptHandles []string `xml:"ReceiptHandle"`
}

Jump to

Keyboard shortcuts

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