rmqtool

package module
v0.0.0-...-3e92a19 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 17 Imported by: 3

README

go-rmqtool

golang rabbitmq tools

GoDoc Build Status

Go versions 1.9+

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultClientTimeout               time.Duration = 3 * time.Second //请求超时
	DefaultTransportInsecureSkipVerify bool          = false           //是否忽略ssl验证
	DefaultTransportDisableCompression bool          = true            //是否禁止压缩
)
View Source
var (
	DefaultConsumerRetryTime time.Duration = 3 * time.Second
	DefaultConsumerToolName  string        = "golang.rmqtool"
)
View Source
var (
	DefaultPublisherRetryTime   time.Duration = 3 * time.Second
	DefaultPublisherChannelSize int32         = 2000
)

Functions

func APIAlivenessTest

func APIAlivenessTest(api, user, passwd, vhost string) (map[string]interface{}, error)

func APIChangeDefinitions

func APIChangeDefinitions(api, user, passwd string, config map[string]interface{}) error

func APIChangeVhostDefinitions

func APIChangeVhostDefinitions(api, user, passwd, vhost string, config map[string]interface{}) error

func APIChannel

func APIChannel(api, user, passwd, name string) (map[string]interface{}, error)

func APIChnageClusterName

func APIChnageClusterName(api, user, passwd string, params map[string]interface{}) error

func APIClusterName

func APIClusterName(api, user, passwd string) (map[string]interface{}, error)

func APIConnection

func APIConnection(api, user, passwd, name string) (map[string]interface{}, error)

func APICreateExchange

func APICreateExchange(api, user, passwd, vhost, name string, params map[string]interface{}) error

func APICreateGlobalParameter

func APICreateGlobalParameter(api, user, passwd, name string, data map[string]interface{}) error

func APICreateParameter

func APICreateParameter(api, user, passwd, component, vhost, pname string, data map[string]interface{}) error

func APICreatePermission

func APICreatePermission(api, user, passwd, vhost, username string, data map[string]interface{}) error

func APICreatePolicy

func APICreatePolicy(api, user, passwd, vhost, name string, data map[string]interface{}) error

func APICreateQueue

func APICreateQueue(api, user, passwd, vhost, name string, params map[string]interface{}) error

func APICreateUser

func APICreateUser(api, user, passwd, name string, data map[string]interface{}) error

func APICreateVhost

func APICreateVhost(api, user, passwd, name string, tracing bool) error

func APIDefinitions

func APIDefinitions(api, user, passwd string) (map[string]interface{}, error)

func APIDeleteExchange

func APIDeleteExchange(api, user, passwd, vhost, name string) error

func APIDeleteGlobalParameter

func APIDeleteGlobalParameter(api, user, passwd, name string) error

func APIDeleteParameter

func APIDeleteParameter(api, user, passwd, component, vhost, name string) error

func APIDeletePermission

func APIDeletePermission(api, user, passwd, vhost, username string) error

func APIDeletePolicy

func APIDeletePolicy(api, user, passwd, vhost, name string) error

func APIDeleteQueue

func APIDeleteQueue(api, user, passwd, vhost, name string) error

func APIDeleteUser

func APIDeleteUser(api, user, passwd, name string) error

func APIDeleteVhost

func APIDeleteVhost(api, user, passwd, name string) error

func APIExchange

func APIExchange(api, user, passwd, vhost, name string) (map[string]interface{}, error)

func APIExchangeBinding

func APIExchangeBinding(api, user, passwd, vhost, source, destination, props string) (map[string]interface{}, error)

func APIExchangeBindings

func APIExchangeBindings(api, user, passwd, vhost, source, destination string) ([]map[string]interface{}, error)

func APIExchangeCreateBinding

func APIExchangeCreateBinding(api, user, passwd, vhost, source, destination, key string, args map[string]interface{}) (string, error)

func APIExchangeDeleteBinding

func APIExchangeDeleteBinding(api, user, passwd, vhost, source, destination, props string) error

func APIExchangePublish

func APIExchangePublish(api, user, passwd, vhost, name string, params map[string]interface{}) (map[string]interface{}, error)

func APIForceDeleteConnection

func APIForceDeleteConnection(api, user, passwd, name, reason string) error

func APIForceDeleteExchange

func APIForceDeleteExchange(api, user, passwd, vhost, name string) error

func APIForceDeleteQueue

func APIForceDeleteQueue(api, user, passwd, vhost, name string) error

func APIGlobalParameter

func APIGlobalParameter(api, user, passwd, name string) (map[string]interface{}, error)

func APIHealthCheck

func APIHealthCheck(api, user, passwd string) error

func APIListChannels

func APIListChannels(api, user, passwd string) ([]map[string]interface{}, error)

func APIListConnectionChannels

func APIListConnectionChannels(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIListConnections

func APIListConnections(api, user, passwd string) ([]map[string]interface{}, error)

func APIListConsumers

func APIListConsumers(api, user, passwd string) ([]map[string]interface{}, error)

func APIListExchangeDestinationBindings

func APIListExchangeDestinationBindings(api, user, passwd, vhost, name string) ([]map[string]interface{}, error)

func APIListExchangeSourceBindings

func APIListExchangeSourceBindings(api, user, passwd, vhost, name string) ([]map[string]interface{}, error)

func APIListExchanges

func APIListExchanges(api, user, passwd string) ([]map[string]interface{}, error)

func APIListExtensions

func APIListExtensions(api, user, passwd string) ([]map[string]interface{}, error)

func APIListGlobalParameters

func APIListGlobalParameters(api, user, passwd string) ([]map[string]interface{}, error)

func APIListNodes

func APIListNodes(api, user, passwd string) ([]map[string]interface{}, error)

func APIListParameters

func APIListParameters(api, user, passwd, component, vhost string) ([]map[string]interface{}, error)

func APIListPermissions

func APIListPermissions(api, user, passwd string) ([]map[string]interface{}, error)

func APIListPolicies

func APIListPolicies(api, user, passwd, vhost string) ([]map[string]interface{}, error)

func APIListQueues

func APIListQueues(api, user, passwd, vhost string) ([]map[string]interface{}, error)

func APIListUsers

func APIListUsers(api, user, passwd string) ([]map[string]interface{}, error)

func APIListVhostChannels

func APIListVhostChannels(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIListVhostConnections

func APIListVhostConnections(api, user, passwd, vhost string) ([]map[string]interface{}, error)

func APIListVhostConsumers

func APIListVhostConsumers(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIListVhostExchanges

func APIListVhostExchanges(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIListVhosts

func APIListVhosts(api, user, passwd string) ([]map[string]interface{}, error)

func APINode

func APINode(api, user, passwd, name string, params map[string]string) (map[string]interface{}, error)

func APINodeHealthCheck

func APINodeHealthCheck(api, user, passwd, node string) error

func APIOverview

func APIOverview(api, user, passwd string) (map[string]interface{}, error)

func APIParameter

func APIParameter(api, user, passwd, component, vhost, pname string) (map[string]interface{}, error)

func APIPermission

func APIPermission(api, user, passwd, vhost, username string) (map[string]interface{}, error)

func APIPolicy

func APIPolicy(api, user, passwd, vhost, name string) (map[string]interface{}, error)

func APIPurgeQueue

func APIPurgeQueue(api, user, passwd, vhost, name string) error

func APIQueue

func APIQueue(api, user, passwd, vhost, name string) (map[string]interface{}, error)

func APIQueueBindings

func APIQueueBindings(api, user, passwd, vhost, name string) ([]map[string]interface{}, error)

func APIQueueCreateExchangeBinding

func APIQueueCreateExchangeBinding(api, user, passwd, vhost, exchange, name, key string, args map[string]interface{}) (string, error)

func APIQueueDeleteExchangeBinding

func APIQueueDeleteExchangeBinding(api, user, passwd, vhost, exchange, name, props string) error

func APIQueueExchangeBinding

func APIQueueExchangeBinding(api, user, passwd, vhost, exchange, name, props string) (map[string]interface{}, error)

func APIQueueExchangeBindings

func APIQueueExchangeBindings(api, user, passwd, vhost, exchange, name string) ([]map[string]interface{}, error)

func APIQueueMessages

func APIQueueMessages(api, user, passwd, vhost, name string, params map[string]interface{}) ([]map[string]interface{}, error)

func APIQuickRegisterQueue

func APIQuickRegisterQueue(api, user, passwd, vhost, name string, bindings map[string][]string) error

func APIUser

func APIUser(api, user, passwd, name string) (map[string]interface{}, error)

func APIUserPermissions

func APIUserPermissions(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIVhost

func APIVhost(api, user, passwd, name string) (map[string]interface{}, error)

func APIVhostDefinitions

func APIVhostDefinitions(api, user, passwd, vhost string) (map[string]interface{}, error)

func APIVhostPermissions

func APIVhostPermissions(api, user, passwd, name string) ([]map[string]interface{}, error)

func APIWhoAmI

func APIWhoAmI(api, user, passwd string) (map[string]interface{}, error)

func GenerateConsumerName

func GenerateConsumerName(name string) string

Types

type APIClient

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

func NewAPIClient

func NewAPIClient(api, user, passwd string) *APIClient

func (*APIClient) APIBindings

func (c *APIClient) APIBindings(api, user, passwd, vhost string) ([]map[string]interface{}, error)

func (*APIClient) AlivenessTest

func (c *APIClient) AlivenessTest(vhost string) (map[string]interface{}, error)

func (*APIClient) Bindings

func (c *APIClient) Bindings(vhost string) ([]map[string]interface{}, error)

func (*APIClient) ChangeClusterName

func (c *APIClient) ChangeClusterName(params map[string]interface{}) error

func (*APIClient) ChangeDefinitions

func (c *APIClient) ChangeDefinitions(config map[string]interface{}) error

func (*APIClient) ChangeVhostDefinitions

func (c *APIClient) ChangeVhostDefinitions(vhost string, config map[string]interface{}) error

func (*APIClient) Channel

func (c *APIClient) Channel(name string) (map[string]interface{}, error)

func (*APIClient) Check

func (c *APIClient) Check() error

func (*APIClient) CheckUserPasswordHash

func (c *APIClient) CheckUserPasswordHash(passwd, hash string) bool

func (*APIClient) ClusterName

func (c *APIClient) ClusterName() (map[string]interface{}, error)

func (*APIClient) Connection

func (c *APIClient) Connection(name string) (map[string]interface{}, error)

func (*APIClient) CreateExchange

func (c *APIClient) CreateExchange(vhost, name string, params map[string]interface{}) error

func (*APIClient) CreateGlobalParameter

func (c *APIClient) CreateGlobalParameter(name string, data map[string]interface{}) error

func (*APIClient) CreateParameter

func (c *APIClient) CreateParameter(component, vhost, name string, data map[string]interface{}) error

func (*APIClient) CreatePermission

func (c *APIClient) CreatePermission(vhost, user string, data map[string]interface{}) error

func (*APIClient) CreatePolicy

func (c *APIClient) CreatePolicy(vhost, name string, data map[string]interface{}) error

func (*APIClient) CreateQueue

func (c *APIClient) CreateQueue(vhost, name string, params map[string]interface{}) error

func (*APIClient) CreateUser

func (c *APIClient) CreateUser(name string, data map[string]interface{}) error

func (*APIClient) CreateVhost

func (c *APIClient) CreateVhost(name string, tracing bool) error

func (*APIClient) DELETE

func (c *APIClient) DELETE(paths interface{}) (*http.Response, error)

func (*APIClient) Definitions

func (c *APIClient) Definitions() (map[string]interface{}, error)

func (*APIClient) DeleteExchange

func (c *APIClient) DeleteExchange(vhost, name string) error

func (*APIClient) DeleteGlobalParameter

func (c *APIClient) DeleteGlobalParameter(name string) error

func (*APIClient) DeleteParameter

func (c *APIClient) DeleteParameter(component, vhost, name string) error

func (*APIClient) DeletePermission

func (c *APIClient) DeletePermission(vhost, user string) error

func (*APIClient) DeletePolicy

func (c *APIClient) DeletePolicy(vhost, name string) error

func (*APIClient) DeleteQueue

func (c *APIClient) DeleteQueue(vhost, name string) error

func (*APIClient) DeleteUser

func (c *APIClient) DeleteUser(name string) error

func (*APIClient) DeleteVhost

func (c *APIClient) DeleteVhost(name string) error

func (*APIClient) Do

func (c *APIClient) Do(req *http.Request) (*http.Response, error)

func (*APIClient) Exchange

func (c *APIClient) Exchange(vhost, name string) (map[string]interface{}, error)

func (*APIClient) ExchangeBinding

func (c *APIClient) ExchangeBinding(vhost, source, destination, props string) (map[string]interface{}, error)

func (*APIClient) ExchangeBindings

func (c *APIClient) ExchangeBindings(vhost, source, destination string) ([]map[string]interface{}, error)

func (*APIClient) ExchangeCreateBinding

func (c *APIClient) ExchangeCreateBinding(vhost, source, destination, key string, args map[string]interface{}) (string, error)

func (*APIClient) ExchangeDeleteBinding

func (c *APIClient) ExchangeDeleteBinding(vhost, source, destination, props string) error

func (*APIClient) ExchangePublish

func (c *APIClient) ExchangePublish(vhost, name string, params map[string]interface{}) (map[string]interface{}, error)

func (*APIClient) ForceDeleteConnection

func (c *APIClient) ForceDeleteConnection(name, reason string) error

func (*APIClient) ForceDeleteExchange

func (c *APIClient) ForceDeleteExchange(vhost, name string) error

func (*APIClient) ForceDeleteQueue

func (c *APIClient) ForceDeleteQueue(vhost, name string) error

func (*APIClient) GET

func (c *APIClient) GET(paths interface{}) (*http.Response, error)

func (*APIClient) GenerateUserPasswordHash

func (c *APIClient) GenerateUserPasswordHash(passwd string) string

func (*APIClient) GlobalParameter

func (c *APIClient) GlobalParameter(name string) (map[string]interface{}, error)

func (*APIClient) HealthCheck

func (c *APIClient) HealthCheck() error

func (*APIClient) ListChannels

func (c *APIClient) ListChannels() ([]map[string]interface{}, error)

func (*APIClient) ListConnectionChannels

func (c *APIClient) ListConnectionChannels(name string) ([]map[string]interface{}, error)

func (*APIClient) ListConnections

func (c *APIClient) ListConnections() ([]map[string]interface{}, error)

func (*APIClient) ListConsumers

func (c *APIClient) ListConsumers() ([]map[string]interface{}, error)

func (*APIClient) ListExchangeDestinationBindings

func (c *APIClient) ListExchangeDestinationBindings(vhost, name string) ([]map[string]interface{}, error)

func (*APIClient) ListExchangeSourceBindings

func (c *APIClient) ListExchangeSourceBindings(vhost, name string) ([]map[string]interface{}, error)

func (*APIClient) ListExchanges

func (c *APIClient) ListExchanges() ([]map[string]interface{}, error)

func (*APIClient) ListExtensions

func (c *APIClient) ListExtensions() ([]map[string]interface{}, error)

func (*APIClient) ListGlobalParameters

func (c *APIClient) ListGlobalParameters() ([]map[string]interface{}, error)

func (*APIClient) ListNodes

func (c *APIClient) ListNodes() ([]map[string]interface{}, error)

func (*APIClient) ListParameters

func (c *APIClient) ListParameters(component, vhost string) ([]map[string]interface{}, error)

func (*APIClient) ListPermissions

func (c *APIClient) ListPermissions() ([]map[string]interface{}, error)

func (*APIClient) ListPolicies

func (c *APIClient) ListPolicies(vhost string) ([]map[string]interface{}, error)

func (*APIClient) ListQueues

func (c *APIClient) ListQueues(vhost string) ([]map[string]interface{}, error)

func (*APIClient) ListUsers

func (c *APIClient) ListUsers() ([]map[string]interface{}, error)

func (*APIClient) ListVhostChannels

func (c *APIClient) ListVhostChannels(name string) ([]map[string]interface{}, error)

func (*APIClient) ListVhostConnections

func (c *APIClient) ListVhostConnections(vhost string) ([]map[string]interface{}, error)

func (*APIClient) ListVhostConsumers

func (c *APIClient) ListVhostConsumers(name string) ([]map[string]interface{}, error)

func (*APIClient) ListVhostExchanges

func (c *APIClient) ListVhostExchanges(name string) ([]map[string]interface{}, error)

func (*APIClient) ListVhosts

func (c *APIClient) ListVhosts() ([]map[string]interface{}, error)

func (*APIClient) NewRequest

func (c *APIClient) NewRequest(method string, paths interface{}, data interface{}) (*http.Request, error)

func (*APIClient) Node

func (c *APIClient) Node(name string, params map[string]string) (map[string]interface{}, error)

func (*APIClient) NodeHealthCheck

func (c *APIClient) NodeHealthCheck(node string) error

func (*APIClient) Overview

func (c *APIClient) Overview() (map[string]interface{}, error)

func (*APIClient) POST

func (c *APIClient) POST(paths interface{}, data interface{}) (*http.Response, error)

func (*APIClient) PUT

func (c *APIClient) PUT(paths interface{}, data interface{}) (*http.Response, error)

func (*APIClient) Parameter

func (c *APIClient) Parameter(component, vhost, name string) (map[string]interface{}, error)

func (*APIClient) Permission

func (c *APIClient) Permission(vhost, user string) (map[string]interface{}, error)

func (*APIClient) Policy

func (c *APIClient) Policy(vhost, name string) (map[string]interface{}, error)

func (*APIClient) PurgeQueue

func (c *APIClient) PurgeQueue(vhost, name string) error

func (*APIClient) Queue

func (c *APIClient) Queue(vhost, name string) (map[string]interface{}, error)

func (*APIClient) QueueBindings

func (c *APIClient) QueueBindings(vhost, name string) ([]map[string]interface{}, error)

func (*APIClient) QueueCreateExchangeBinding

func (c *APIClient) QueueCreateExchangeBinding(vhost, exchange, name, key string, args map[string]interface{}) (string, error)

func (*APIClient) QueueDeleteExchangeBinding

func (c *APIClient) QueueDeleteExchangeBinding(vhost, exchange, name, props string) error

func (*APIClient) QueueExchangeBinding

func (c *APIClient) QueueExchangeBinding(vhost, exchange, name, props string) (map[string]interface{}, error)

func (*APIClient) QueueExchangeBindings

func (c *APIClient) QueueExchangeBindings(vhost, exchange, name string) ([]map[string]interface{}, error)

func (*APIClient) QueueMessages

func (c *APIClient) QueueMessages(vhost, name string, params map[string]interface{}) ([]map[string]interface{}, error)

func (*APIClient) QuickRegisterQueue

func (c *APIClient) QuickRegisterQueue(vhost, name string, bindings map[string][]string) error

func (*APIClient) ScanByte

func (c *APIClient) ScanByte(resp *http.Response, err error) ([]byte, error)

func (*APIClient) ScanCreate

func (c *APIClient) ScanCreate(resp *http.Response, err error) error

func (*APIClient) ScanDelete

func (c *APIClient) ScanDelete(resp *http.Response, err error) error

func (*APIClient) ScanMap

func (c *APIClient) ScanMap(resp *http.Response, err error) (map[string]interface{}, error)

func (*APIClient) ScanSlice

func (c *APIClient) ScanSlice(resp *http.Response, err error) ([]map[string]interface{}, error)

func (*APIClient) ScanUpdate

func (c *APIClient) ScanUpdate(resp *http.Response, err error) error

func (*APIClient) SetApi

func (c *APIClient) SetApi(api string) *APIClient

func (*APIClient) SetAuth

func (c *APIClient) SetAuth(user, passwd string) *APIClient

func (*APIClient) User

func (c *APIClient) User(name string) (map[string]interface{}, error)

func (*APIClient) UserPermissions

func (c *APIClient) UserPermissions(name string) ([]map[string]interface{}, error)

func (*APIClient) Vhost

func (c *APIClient) Vhost(name string) (map[string]interface{}, error)

func (*APIClient) VhostDefinitions

func (c *APIClient) VhostDefinitions(vhost string) (map[string]interface{}, error)

func (*APIClient) VhostPermissions

func (c *APIClient) VhostPermissions(name string) ([]map[string]interface{}, error)

func (*APIClient) WhoAmI

func (c *APIClient) WhoAmI() (map[string]interface{}, error)

type Connect

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

func NewConnect

func NewConnect(config ConnectConfig) *Connect

func (*Connect) APIClient

func (c *Connect) APIClient() *APIClient

func (*Connect) Api

func (c *Connect) Api() string

func (*Connect) ApplyPublisher

func (c *Connect) ApplyPublisher(exchange string, routeKeys []string) (*PublisherTool, error)

func (*Connect) ApplyQueue

func (c *Connect) ApplyQueue(name string) *Queue

func (*Connect) ApplyQueueWithArgs

func (c *Connect) ApplyQueueWithArgs(name string, args amqp.Table) *Queue

func (*Connect) Clone

func (c *Connect) Clone() *Connect

func (*Connect) Dial

func (c *Connect) Dial() (*amqp.Connection, error)

func (*Connect) DialConfig

func (c *Connect) DialConfig(config amqp.Config) (*amqp.Connection, error)

func (*Connect) DialTLS

func (c *Connect) DialTLS(config *tls.Config) (*amqp.Connection, error)

func (*Connect) Passwd

func (c *Connect) Passwd() string

func (*Connect) QuickCreateExchange

func (c *Connect) QuickCreateExchange(name, kind string, durable bool) error

func (*Connect) QuickCreateQueue

func (c *Connect) QuickCreateQueue(name string, durable bool, args amqp.Table) error

func (*Connect) QuickDeleteExchange

func (c *Connect) QuickDeleteExchange(name string) error

func (*Connect) QuickDeleteQueue

func (c *Connect) QuickDeleteQueue(name string) error

func (*Connect) QuickExchangeBind

func (c *Connect) QuickExchangeBind(destination, key, source string) error

func (*Connect) QuickExchangeUnbind

func (c *Connect) QuickExchangeUnbind(destination, key, source string) error

func (*Connect) QuickPurgeQueue

func (c *Connect) QuickPurgeQueue(name string) error

func (*Connect) QuickQueueBind

func (c *Connect) QuickQueueBind(name, key, exchange string, args amqp.Table) error

func (*Connect) QuickQueueUnbind

func (c *Connect) QuickQueueUnbind(name, key, exchange string, args amqp.Table) error

func (*Connect) Scheme

func (c *Connect) Scheme() string

func (*Connect) User

func (c *Connect) User() string

func (*Connect) Vhost

func (c *Connect) Vhost() string

type ConnectConfig

type ConnectConfig struct {
	Host     string                 `json:"host" yaml:"host"`         //127.0.0.1:5672
	Api      string                 `json:"api" yaml:"api"`           //http://127.0.0.1:15672
	User     string                 `json:"user" yaml:"user"`         //username
	Passwd   string                 `json:"passwd" yaml:"passwd"`     //passwd
	Vhost    string                 `json:"vhost" yaml:"vhost"`       //vhost
	MetaData map[string]interface{} `json:"metadata" yaml:"metadata"` //metadata
}

func (*ConnectConfig) Scheme

func (c *ConnectConfig) Scheme() string

type ConsumerTool

type ConsumerTool struct {
	RetryTime time.Duration
	// contains filtered or unexported fields
}

func NewConsumerTool

func NewConsumerTool(url, queue string) (*ConsumerTool, error)

func (*ConsumerTool) Close

func (c *ConsumerTool) Close()

func (*ConsumerTool) Consume

func (c *ConsumerTool) Consume(nums int, handle func(amqp.Delivery))
func (c *ConsumerTool) Link(prefetchCount int) (*amqp.Channel, error)

func (*ConsumerTool) Name

func (c *ConsumerTool) Name() string

func (*ConsumerTool) Process

func (c *ConsumerTool) Process(channel *amqp.Channel, consumerName string, quitSingle chan string, handle func(amqp.Delivery))

func (*ConsumerTool) SetName

func (c *ConsumerTool) SetName(name string) string

type DefaultLog

type DefaultLog struct {
	LoggerInterface
}

func (*DefaultLog) Debug

func (c *DefaultLog) Debug(format string, v ...interface{})

func (*DefaultLog) Error

func (c *DefaultLog) Error(format string, v ...interface{})

func (*DefaultLog) Fatal

func (c *DefaultLog) Fatal(format string, v ...interface{})

func (*DefaultLog) Info

func (c *DefaultLog) Info(format string, v ...interface{})

func (*DefaultLog) Panic

func (c *DefaultLog) Panic(format string, v ...interface{})

func (*DefaultLog) Warn

func (c *DefaultLog) Warn(format string, v ...interface{})

type Logger

type Logger struct {
	// contains filtered or unexported fields
}
var (
	Log *Logger
)

func (*Logger) Debug

func (c *Logger) Debug(format string, v ...interface{})

func (*Logger) Error

func (c *Logger) Error(format string, v ...interface{})

func (*Logger) Fatal

func (c *Logger) Fatal(format string, v ...interface{})

func (*Logger) Info

func (c *Logger) Info(format string, v ...interface{})

func (*Logger) Panic

func (c *Logger) Panic(format string, v ...interface{})

func (*Logger) Set

func (c *Logger) Set(instance interface{})

func (*Logger) Warn

func (c *Logger) Warn(format string, v ...interface{})

type LoggerInterface

type LoggerInterface interface {
	Error(string, ...interface{})
	Debug(string, ...interface{})
	Fatal(string, ...interface{})
	Panic(string, ...interface{})
	Warn(string, ...interface{})
	Info(string, ...interface{})
}

type PublisherTool

type PublisherTool struct {
	RetryTime time.Duration
	// contains filtered or unexported fields
}

func NewPublisherTool

func NewPublisherTool(url, exchange string, routeKeys []string) (*PublisherTool, error)

func (*PublisherTool) GetSafeChannel

func (c *PublisherTool) GetSafeChannel(route string) (*amqp.Channel, error)

func (*PublisherTool) Publish

func (c *PublisherTool) Publish(route string, msg amqp.Publishing)

func (*PublisherTool) PublishExt

func (c *PublisherTool) PublishExt(route, fix string, msg amqp.Publishing)

func (*PublisherTool) SafePublish

func (c *PublisherTool) SafePublish(route string, msg amqp.Publishing) error

type Queue

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

func (*Queue) Api

func (c *Queue) Api() string

func (*Queue) ApplyConsumer

func (c *Queue) ApplyConsumer() (*ConsumerTool, error)

func (*Queue) Args

func (c *Queue) Args() amqp.Table

func (*Queue) Bind

func (c *Queue) Bind(bind *QueueBind) error

func (*Queue) Binds

func (c *Queue) Binds(bindList []*QueueBind) error

func (*Queue) Clone

func (c *Queue) Clone(name string) *Queue

func (*Queue) Close

func (c *Queue) Close()

func (*Queue) Consume

func (c *Queue) Consume(prefetchCount int, handle func(amqp.Delivery)) error

func (*Queue) Create

func (c *Queue) Create() error

func (*Queue) Delete

func (c *Queue) Delete() error

func (*Queue) Ensure

func (c *Queue) Ensure(bindList []*QueueBind) error

func (*Queue) Name

func (c *Queue) Name() string

func (*Queue) Passwd

func (c *Queue) Passwd() string

func (*Queue) Purge

func (c *Queue) Purge() error

func (*Queue) Scheme

func (c *Queue) Scheme() string

func (*Queue) Unbind

func (c *Queue) Unbind(bind *QueueBind) error

func (*Queue) User

func (c *Queue) User() string

func (*Queue) Vhost

func (c *Queue) Vhost() string

type QueueBind

type QueueBind struct {
	Key       string     `yaml:"key"`
	Exchange  string     `yaml:"exchange"`
	Arguments amqp.Table `yaml:"arguments"`
}

type QueueConfig

type QueueConfig struct {
	Name     string       `yaml:"name"`
	Args     amqp.Table   `yaml:"args"`
	Bindlist []*QueueBind `yaml:"bindlist"`
}

Jump to

Keyboard shortcuts

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