client

package
v0.0.0-...-c59394f Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (

	// DefaultSquad is the default squad name
	DefaultSquad = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for one sqs client

func New

func New(endpoint string, accessKey string, secretKey string) *Client

New allocates a new Client

func (*Client) Queue

func (cli *Client) Queue(name string, squad string) (*QueueClient, error)

Queue returns a new QueueClient with the given name

type Message

type Message struct {
	MessageID int64  `json:"message_id"`
	Content   string `json:"content"`
}

Message for a message entry

type Option

type Option struct {
	// Endpoint for main server
	Endpoint string
	models.UserAuth
}

Option for Client options

type QueueClient

type QueueClient struct {
	*Client

	BaseInfo models.NodeRequestParams
	// contains filtered or unexported fields
}

QueueClient for one query client

func (*QueueClient) ApplyNode

func (cli *QueueClient) ApplyNode() error

ApplyNode applies for a available node

func (*QueueClient) PullMessages

func (cli *QueueClient) PullMessages(handler func([]Message) error) error

PullMessages for pull message request

func (*QueueClient) PushMessage

func (cli *QueueClient) PushMessage(content string) error

PushMessage pushes a message

Jump to

Keyboard shortcuts

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