aliyungo: github.com/denverdino/aliyungo/mns Index | Files

package mns

import "github.com/denverdino/aliyungo/mns"

Index

Package Files

client.go queue.go request.go signature.go types.go util.go

Constants

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

func GetCurrentMillisecond Uses

func GetCurrentMillisecond() int64

获取当前时间戳(毫秒)

func GetCurrentUnixMicro Uses

func GetCurrentUnixMicro() int64

获取当前时间戳(秒)

func HamSha1 Uses

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

func Md5 Uses

func Md5(byteMessage []byte) string

对数据进行md5计算

func Sha1 Uses

func Sha1(data string) string

对字符串进行sha1 计算

type Client Uses

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

func NewClient Uses

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

func NewClientForAssumeRole Uses

func NewClientForAssumeRole(accessKeyId, accessKeySecret, securityToken, endpoint string) (client *Client)

func (*Client) SetDebug Uses

func (client *Client) SetDebug(debug bool)

func (*Client) SetTransport Uses

func (client *Client) SetTransport(transport http.RoundTripper)

SetTransport sets transport to the http client

func (*Client) SignRequest Uses

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

授权签名

type Error Uses

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

func (*Error) Error Uses

func (err *Error) Error() string

type Message Uses

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

type MsgReceive Uses

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 Uses

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

type Queue Uses

type Queue struct {
    *Client
    QueueName string
    Base64    bool
}

func (*Queue) Delete Uses

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

删除队列消息

func (*Queue) Receive Uses

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

消费队列消息

func (*Queue) Send Uses

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

发送队列消息

Package mns imports 18 packages (graph) and is imported by 1 packages. Updated 2020-02-10. Refresh now. Tools for package owners.