rabbithole

package module
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: BSD-2-Clause Imports: 14 Imported by: 27

README

Rabbit Hole, a RabbitMQ HTTP API Client for Go

This library is a RabbitMQ HTTP API client for the Go language.

Supported Go Versions

Rabbit Hole targets two latests stable Go versions available at the time of the library release. Older versions may work but this is not guaranteed.

Supported RabbitMQ Versions

All versions require RabbitMQ Management UI plugin to be installed and enabled.

Build Status

Travis CI Tests

Project Maturity

Rabbit Hole is a mature library (first released in late 2013) designed after a couple of other RabbitMQ HTTP API clients with stable APIs. Breaking API changes are not out of the question but not without a reasonable version bump.

It is largely feature complete and decently documented.

Change Log

If upgrading from an earlier release, please consult with the change log.

Installation

go get github.com/michaelklishin/rabbit-hole/v2

# or, for v1.x:
# go get github.com/michaelklishin/rabbit-hole

Documentation

API Reference

API reference is available on godoc.org.

Continue reading for a list of example snippets.

Overview

To import the package:

import (
       "github.com/michaelklishin/rabbit-hole/v2"
)

All HTTP API operations are accessible via rabbithole.Client, which should be instantiated with rabbithole.NewClient:

// URI, username, password
rmqc, _ = NewClient("http://127.0.0.1:15672", "guest", "guest")

TLS (HTTPS) can be enabled by adding an HTTP transport to the parameters of rabbithole.NewTLSClient:

transport := &http.Transport{TLSClientConfig: tlsConfig}
rmqc, _ := NewTLSClient("https://127.0.0.1:15672", "guest", "guest", transport)

RabbitMQ HTTP API has to be configured to use TLS.

Getting Overview
resp, err := rmqc.Overview()
Node and Cluster Status
xs, err := rmqc.ListNodes()
// => []NodeInfo, err

node, err := rmqc.GetNode("rabbit@mercurio")
// => NodeInfo, err
Operations on Connections
xs, err := rmqc.ListConnections()
// => []ConnectionInfo, err

conn, err := rmqc.GetConnection("127.0.0.1:50545 -> 127.0.0.1:5672")
// => ConnectionInfo, err

// Forcefully close connection
_, err := rmqc.CloseConnection("127.0.0.1:50545 -> 127.0.0.1:5672")
// => *http.Response, err
Operations on Channels
xs, err := rmqc.ListChannels()
// => []ChannelInfo, err

ch, err := rmqc.GetChannel("127.0.0.1:50545 -> 127.0.0.1:5672 (1)")
// => ChannelInfo, err
Operations on Vhosts
xs, err := rmqc.ListVhosts()
// => []VhostInfo, err

// information about individual vhost
x, err := rmqc.GetVhost("/")
// => VhostInfo, err

// creates or updates individual vhost
resp, err := rmqc.PutVhost("/", VhostSettings{Tracing: false})
// => *http.Response, err

// deletes individual vhost
resp, err := rmqc.DeleteVhost("/")
// => *http.Response, err
Managing Users
xs, err := rmqc.ListUsers()
// => []UserInfo, err

// information about individual user
x, err := rmqc.GetUser("my.user")
// => UserInfo, err

// creates or updates individual user
resp, err := rmqc.PutUser("my.user", UserSettings{Password: "s3krE7", Tags: "management,policymaker"})
// => *http.Response, err

// creates or updates individual user with no password
resp, err := rmqc.PutUserWithoutPassword("my.user", UserSettings{Tags: "management,policymaker"})
// => *http.Response, err

// deletes individual user
resp, err := rmqc.DeleteUser("my.user")
// => *http.Response, err
// creates or updates individual user with a Base64-encoded SHA256 password hash
hash := Base64EncodedSaltedPasswordHashSHA256("password-s3krE7")
resp, err := rmqc.PutUser("my.user", UserSettings{
  PasswordHash: hash,
  HashingAlgorithm: HashingAlgorithmSHA256,
  Tags: "management,policymaker"})
// => *http.Response, err
Managing Permissions
xs, err := rmqc.ListPermissions()
// => []PermissionInfo, err

// permissions of individual user
x, err := rmqc.ListPermissionsOf("my.user")
// => []PermissionInfo, err

// permissions of individual user in vhost
x, err := rmqc.GetPermissionsIn("/", "my.user")
// => PermissionInfo, err

// updates permissions of user in vhost
resp, err := rmqc.UpdatePermissionsIn("/", "my.user", Permissions{Configure: ".*", Write: ".*", Read: ".*"})
// => *http.Response, err

// revokes permissions in vhost
resp, err := rmqc.ClearPermissionsIn("/", "my.user")
// => *http.Response, err
Operations on Exchanges
xs, err := rmqc.ListExchanges()
// => []ExchangeInfo, err

// list exchanges in a vhost
xs, err := rmqc.ListExchangesIn("/")
// => []ExchangeInfo, err

// information about individual exchange
x, err := rmqc.GetExchange("/", "amq.fanout")
// => ExchangeInfo, err

// declares an exchange
resp, err := rmqc.DeclareExchange("/", "an.exchange", ExchangeSettings{Type: "fanout", Durable: false})
// => *http.Response, err

// deletes individual exchange
resp, err := rmqc.DeleteExchange("/", "an.exchange")
// => *http.Response, err
Operations on Queues
qs, err := rmqc.ListQueues()
// => []QueueInfo, err

// list queues in a vhost
qs, err := rmqc.ListQueuesIn("/")
// => []QueueInfo, err

// information about individual queue
q, err := rmqc.GetQueue("/", "a.queue")
// => QueueInfo, err

// declares a queue
resp, err := rmqc.DeclareQueue("/", "a.queue", QueueSettings{Durable: false})
// => *http.Response, err

// deletes individual queue
resp, err := rmqc.DeleteQueue("/", "a.queue")
// => *http.Response, err

// purges all messages in queue
resp, err := rmqc.PurgeQueue("/", "a.queue")
// => *http.Response, err

// synchronises all messages in queue with the rest of mirrors in the cluster
resp, err := rmqc.SyncQueue("/", "a.queue")
// => *http.Response, err

// cancels queue synchronisation process
resp, err := rmqc.CancelSyncQueue("/", "a.queue")
// => *http.Response, err
Operations on Bindings
bs, err := rmqc.ListBindings()
// => []BindingInfo, err

// list bindings in a vhost
bs, err := rmqc.ListBindingsIn("/")
// => []BindingInfo, err

// list bindings of a queue
bs, err := rmqc.ListQueueBindings("/", "a.queue")
// => []BindingInfo, err

// list all bindings having the exchange as source
bs1, err := rmqc.ListExchangeBindingsWithSource("/", "an.exchange")
// => []BindingInfo, err

// list all bindings having the exchange as destinattion
bs2, err := rmqc.ListExchangeBindingsWithDestination("/", "an.exchange")
// => []BindingInfo, err

// declare a binding
resp, err := rmqc.DeclareBinding("/", BindingInfo{
	Source: "an.exchange",
	Destination: "a.queue",
	DestinationType: "queue",
	RoutingKey: "#",
})
// => *http.Response, err

// deletes individual binding
resp, err := rmqc.DeleteBinding("/", BindingInfo{
	Source: "an.exchange",
	Destination: "a.queue",
	DestinationType: "queue",
	RoutingKey: "#",
	PropertiesKey: "%23",
})
// => *http.Response, err
Operations on Feature Flags
xs, err := rmqc.ListFeatureFlags()
// => []FeatureFlag, err

// enable a feature flag
_, err := rmqc.EnableFeatureFlag("drop_unroutable_metric")
// => *http.Response, err
Operations on Shovels
qs, err := rmqc.ListShovels()
// => []ShovelInfo, err

// list shovels in a vhost
qs, err := rmqc.ListShovelsIn("/")
// => []ShovelInfo, err

// information about an individual shovel
q, err := rmqc.GetShovel("/", "a.shovel")
// => ShovelInfo, err

// declares a shovel
shovelDetails := rabbithole.ShovelDefinition{
	SourceURI: URISet{"amqp://sourceURI"},
	SourceProtocol: "amqp091",
	SourceQueue: "mySourceQueue",
	DestinationURI: "amqp://destinationURI",
	DestinationProtocol: "amqp10",
	DestinationAddress: "myDestQueue",
	DestinationAddForwardHeaders: true,
	AckMode: "on-confirm",
	SrcDeleteAfter: "never",
}
resp, err := rmqc.DeclareShovel("/", "a.shovel", shovelDetails)
// => *http.Response, err

// deletes an individual shovel
resp, err := rmqc.DeleteShovel("/", "a.shovel")
// => *http.Response, err

Operations on Runtime (vhost-scoped) Parameters
// list all runtime parameters
params, err := rmqc.ListRuntimeParameters()
// => []RuntimeParameter, error

// list all runtime parameters for a component
params, err := rmqc.ListRuntimeParametersFor("federation-upstream")
// => []RuntimeParameter, error

// list runtime parameters in a vhost
params, err := rmqc.ListRuntimeParametersIn("federation-upstream", "/")
// => []RuntimeParameter, error

// information about a runtime parameter
p, err := rmqc.GetRuntimeParameter("federation-upstream", "/", "name")
// => *RuntimeParameter, error

// declare or update a runtime parameter
resp, err := rmqc.PutRuntimeParameter("federation-upstream", "/", "name", FederationDefinition{
    Uri: URISet{"amqp://server-name"},
})
// => *http.Response, error

// remove a runtime parameter
resp, err := rmqc.DeleteRuntimeParameter("federation-upstream", "/", "name")
// => *http.Response, error

Operations on Federation Upstreams
// list all federation upstreams
ups, err := rmqc.ListFederationUpstreams()
// => []FederationUpstream, error

// list federation upstreams in a vhost
ups, err := rmqc.ListFederationUpstreamsIn("/")
// => []FederationUpstream, error

// information about a federated upstream
up, err := rmqc.GetFederationUpstream("/", "name")
// => *FederationUpstream, error

// declare or update a federation upstream
resp, err := rmqc.PutFederationUpstream("/", "name", FederationDefinition{
  Uri: URISet{"amqp://server-name"},
})
// => *http.Response, error

// delete an upstream
resp, err := rmqc.DeleteFederationUpstream("/", "name")
// => *http.Response, error

Managing Global Parameters
// list all global parameters
params, err := rmqc.ListGlobalParameters()
// => []GlobalRuntimeParameter, error

// get a global parameter
p, err := rmqc.GetGlobalParameter("name")
// => *GlobalRuntimeParameter, error

// declare or update a global parameter
resp, err := rmqc.PutGlobalParameter("name", map[string]interface{
    endpoints: "amqp://server-name",
})
// => *http.Response, error

// delete a global parameter
resp, err := rmqc.DeleteGlobalParameter("name")
// => *http.Response, error
Managing Policies
mypolicy := Policy{
	Vhost:      "/",
	Pattern:    "^.*$",
	ApplyTo:    "queues",
	Name:       "mypolicy",
	Priority:   0,
	Definition: PolicyDefinition{
		// map[string] interface{}
		"max-length-bytes": 1048576,
	},
}
resp, err := rmqc.PutPolicy("/", "mypolicy", mypolicy)
// => *http.Response, error
xs, err := rmqc.ListPolicies()
// => []Policy, error
x, err := rmqc.GetPolicy("/", "mypolicy")
// => *Policy, error
resp, err := rmqc.DeletePolicy("/", "mypolicy")
// => *http.Response, error
Operations on cluster name
// Get cluster name
cn, err := rmqc.GetClusterName()
// => ClusterName, err

// Rename cluster
resp, err := rmqc.SetClusterName(ClusterName{Name: "rabbitmq@rabbit-hole"})
// => *http.Response, err

HTTPS Connections
var tlsConfig *tls.Config

...

transport := &http.Transport{TLSClientConfig: tlsConfig}

rmqc, err := NewTLSClient("https://127.0.0.1:15672", "guest", "guest", transport)
Changing Transport Layer
var transport http.RoundTripper

...

rmqc.SetTransport(transport)

Contributing

See CONTRIBUTING.md

2-clause BSD license.

(c) Michael S. Klishin and contributors, 2013-2023.

Documentation

Overview

Package rabbithole is a Go client for the RabbitMQ HTTP API.

All HTTP API operations are accessible via `rabbithole.Client`, which should be instantiated with `rabbithole.NewClient`.

// URI, username, password
rmqc, _ = NewClient("http://127.0.0.1:15672", "guest", "guest")

Getting Overview

res, err := rmqc.Overview()

Node and Cluster Status

var err error

// => []NodeInfo, err
xs, err := rmqc.ListNodes()

node, err := rmqc.GetNode("rabbit@mercurio")
// => NodeInfo, err

Operations on Connections

xs, err := rmqc.ListConnections()
// => []ConnectionInfo, err

conn, err := rmqc.GetConnection("127.0.0.1:50545 -> 127.0.0.1:5672")
// => ConnectionInfo, err

// Forcefully close connection
_, err := rmqc.CloseConnection("127.0.0.1:50545 -> 127.0.0.1:5672")
// => *http.Response, err

Operations on Channels

xs, err := rmqc.ListChannels()
// => []ChannelInfo, err

ch, err := rmqc.GetChannel("127.0.0.1:50545 -> 127.0.0.1:5672 (1)")
// => ChannelInfo, err

Operations on Exchanges

xs, err := rmqc.ListExchanges()
// => []ExchangeInfo, err

// list exchanges in a vhost
xs, err := rmqc.ListExchangesIn("/")
// => []ExchangeInfo, err

// information about individual exchange
x, err := rmqc.GetExchange("/", "amq.fanout")
// => ExchangeInfo, err

// declares an exchange
resp, err := rmqc.DeclareExchange("/", "an.exchange", ExchangeSettings{Type: "fanout", Durable: false})
// => *http.Response, err

// deletes individual exchange
resp, err := rmqc.DeleteExchange("/", "an.exchange")
// => *http.Response, err

Operations on Queues

xs, err := rmqc.ListQueues()
// => []QueueInfo, err

// list queues in a vhost
xs, err := rmqc.ListQueuesIn("/")
// => []QueueInfo, err

// information about individual queue
x, err := rmqc.GetQueue("/", "a.queue")
// => QueueInfo, err

// declares a queue
resp, err := rmqc.DeclareQueue("/", "a.queue", QueueSettings{Durable: false})
// => *http.Response, err

// deletes individual queue
resp, err := rmqc.DeleteQueue("/", "a.queue")
// => *http.Response, err

// purges all messages in queue
resp, err := rmqc.PurgeQueue("/", "a.queue")
// => *http.Response, err

Operations on Bindings

bs, err := rmqc.ListBindings()
// => []BindingInfo, err

// list bindings in a vhost
bs, err := rmqc.ListBindingsIn("/")
// => []BindingInfo, err

// list bindings of a queue
bs, err := rmqc.ListQueueBindings("/", "a.queue")
// => []BindingInfo, err

// declare a binding
resp, err := rmqc.DeclareBinding("/", BindingInfo{
    Source: "an.exchange",
    Destination: "a.queue",
    DestinationType: "queue",
    RoutingKey: "#",
})
// => *http.Response, err

// deletes individual binding
resp, err := rmqc.DeleteBinding("/", BindingInfo{
    Source: "an.exchange",
    Destination: "a.queue",
    DestinationType: "queue",
    RoutingKey: "#",
    PropertiesKey: "%23",
})
// => *http.Response, err

Operations on Vhosts

xs, err := rmqc.ListVhosts()
// => []VhostInfo, err

// information about individual vhost
x, err := rmqc.GetVhost("/")
// => VhostInfo, err

// creates or updates individual vhost
resp, err := rmqc.PutVhost("/", VhostSettings{Tracing: false})
// => *http.Response, err

// deletes individual vhost
resp, err := rmqc.DeleteVhost("/")
// => *http.Response, err

Managing Users

xs, err := rmqc.ListUsers()
// => []UserInfo, err

// information about individual user
x, err := rmqc.GetUser("my.user")
// => UserInfo, err

// creates or updates individual user
resp, err := rmqc.PutUser("my.user", UserSettings{Password: "s3krE7", Tags: "management policymaker"})
// => *http.Response, err

// deletes individual user
resp, err := rmqc.DeleteUser("my.user")
// => *http.Response, err

Managing Permissions

xs, err := rmqc.ListPermissions()
// => []PermissionInfo, err

// permissions of individual user
x, err := rmqc.ListPermissionsOf("my.user")
// => []PermissionInfo, err

// permissions of individual user in vhost
x, err := rmqc.GetPermissionsIn("/", "my.user")
// => PermissionInfo, err

// updates permissions of user in vhost
resp, err := rmqc.UpdatePermissionsIn("/", "my.user", Permissions{Configure: ".*", Write: ".*", Read: ".*"})
// => *http.Response, err

// revokes permissions in vhost
resp, err := rmqc.ClearPermissionsIn("/", "my.user")
// => *http.Response, err

Managing Topic Permissions

xs, err := rmqc.ListTopicPermissions()
// => []TopicPermissionInfo, err

// permissions of individual user
x, err := rmqc.ListTopicPermissionsOf("my.user")
// => []TopicPermissionInfo, err

// permissions of individual user in vhost
x, err := rmqc.GetTopicPermissionsIn("/", "my.user")
// => []TopicPermissionInfo, err

// updates permissions of user in vhost
resp, err := rmqc.UpdateTopicPermissionsIn("/", "my.user", Permissions{Exchange: "amq.topic", Write: ".*", Read: ".*"})
// => *http.Response, err

// revokes permissions in vhost
resp, err := rmqc.ClearTopicPermissionsIn("/", "my.user")
// => *http.Response, err

// revokes single permissions in vhost
resp, err := rmqc.DeleteTopicPermissionsIn("/", "my.user", "exchange")
// => *http.Response, err

Managing Runtime Parameters

// list all runtime parameters
params, err := rmqc.ListRuntimeParameters()
// => []RuntimeParameter, error

// list all runtime parameters for a component
params, err := rmqc.ListRuntimeParametersFor("federation-upstream")
// => []RuntimeParameter, error

// list runtime parameters in a vhost
params, err := rmqc.ListRuntimeParametersIn("federation-upstream", "/")
// => []RuntimeParameter, error

// information about a runtime parameter
p, err := rmqc.GetRuntimeParameter("federation-upstream", "/", "name")
// => *RuntimeParameter, error

// declare or update a runtime parameter
resp, err := rmqc.PutRuntimeParameter("federation-upstream", "/", "name", FederationDefinition{
    Uri: "amqp://server-name",
})
// => *http.Response, error

// remove a runtime parameter
resp, err := rmqc.DeleteRuntimeParameter("federation-upstream", "/", "name")
// => *http.Response, error

Managing Federation Upstreams

// list all federation upstreams
ups, err := rmqc.ListFederationUpstreams()
// => []FederationUpstream, error

// list federation upstreams in a vhost
ups, err := rmqc.ListFederationUpstreamsIn("/")
// => []FederationUpstream, error

// information about a federated upstream
up, err := rmqc.GetFederationUpstream("/", "upstream-name")
// => *FederationUpstream, error

// declare or update a federation upstream
resp, err := rmqc.PutFederationUpstream("/", "upstream-name", FederationDefinition{
  Uri: "amqp://server-name",
})
// => *http.Response, error

// delete an upstream
resp, err := rmqc.DeleteFederationUpstream("/", "upstream-name")
// => *http.Response, error

Managing Global Parameters

// list all global parameters
params, err := rmqc.ListGlobalParameters()
// => []GlobalRuntimeParameter, error

// get a global parameter
p, err := rmqc.GetGlobalParameter("name")
// => *GlobalRuntimeParameter, error

// declare or update a global parameter
resp, err := rmqc.PutGlobalParameter("name", map[string]interface{
    endpoints: "amqp://server-name",
})
// => *http.Response, error

// delete a global parameter
resp, err := rmqc.DeleteGlobalParameter("name")
// => *http.Response, error

Operations on cluster name

// Get cluster name
cn, err := rmqc.GetClusterName()
// => ClusterName, err

// Rename cluster
resp, err := rmqc.SetClusterName(ClusterName{Name: "rabbitmq@rabbit-hole"})
// => *http.Response, err

Index

Constants

View Source
const FederationUpstreamComponent string = "federation-upstream"

FederationUpstreamComponent is the name of the runtime parameter component used by federation upstreams.

Variables

This section is empty.

Functions

func Base64EncodedSaltedPasswordHashSHA256

func Base64EncodedSaltedPasswordHashSHA256(password string) string

Base64EncodedSaltedPasswordHashSHA256 produces a salted hash value expected by the HTTP API. See https://www.rabbitmq.com/passwords.html#computing-password-hash for details.

func Base64EncodedSaltedPasswordHashSHA512

func Base64EncodedSaltedPasswordHashSHA512(password string) string

Base64EncodedSaltedPasswordHashSHA512 produces a salted hash value expected by the HTTP API. See https://www.rabbitmq.com/passwords.html#computing-password-hash for details.

func GenerateSalt

func GenerateSalt(n int) string

GenerateSalt generates a password salt. Used to compute password hashes when creating or updating user information. See https://www.rabbitmq.com/passwords.html#computing-password-hash for details.

func SaltedPasswordHashSHA256

func SaltedPasswordHashSHA256(password string) (string, string)

SaltedPasswordHashSHA256 is used to compute SHA-256 password hashes when creating or updating user information. See https://www.rabbitmq.com/passwords.html#computing-password-hash for details.

func SaltedPasswordHashSHA512

func SaltedPasswordHashSHA512(password string) (string, string)

SaltedPasswordHashSHA512 is used to compute SHA-512 password hashes when creating or updating user information. See https://www.rabbitmq.com/passwords.html#computing-password-hash for details.

Types

type AcknowledgementMode

type AcknowledgementMode bool

AcknowledgementMode specifies an acknowledgement mode used by a consumer. Learn more at https://www.rabbitmq.com/confirms.html.

const (
	// ManualAcknowledgement requires the consumer to explicitly
	// acknowledge processed deliveries.
	ManualAcknowledgement AcknowledgementMode = true
	// AutomaticAcknowledgment means that deliveries sent
	// to the consumer will be considered processed immediately.
	// Explicit acks from the client are not needed or expected
	// by the server.
	AutomaticAcknowledgment AcknowledgementMode = false
)

type AlarmInEffect added in v2.7.0

type AlarmInEffect struct {
	Node     string `json:"node"`
	Resource string `json:"resource"`
}

AlarmInEffect represents a resource alarm in effect on a node

type AuthMechanism

type AuthMechanism NameDescriptionEnabled

AuthMechanism is a RabbbitMQ authentication and/or authorization mechanism available on the node.

type AutoDelete added in v2.11.0

type AutoDelete bool

AutoDelete is a boolean but RabbitMQ may return the string "undefined"

func (*AutoDelete) UnmarshalJSON added in v2.11.0

func (d *AutoDelete) UnmarshalJSON(b []byte) error

UnmarshalJSON can unmarshal a string or a boolean

type BackingQueueStatus

type BackingQueueStatus struct {
	Q1 int `json:"q1,omitempty"`
	Q2 int `json:"q2,omitempty"`
	Q3 int `json:"q3,omitempty"`
	Q4 int `json:"q4,omitempty"`
	// Total queue length
	Length int64 `json:"len,omitempty"`
	// Number of pending acks from consumers
	PendingAcks int64 `json:"pending_acks,omitempty"`
	// Number of messages held in RAM
	RAMMessageCount int64 `json:"ram_msg_count,omitempty"`
	// Number of outstanding acks held in RAM
	RAMAckCount int64 `json:"ram_ack_count,omitempty"`
	// Number of persistent messages in the store
	PersistentCount int64 `json:"persistent_count,omitempty"`
	// Average ingress (inbound) rate, not including messages
	// that straight through to auto-acking consumers.
	AverageIngressRate float64 `json:"avg_ingress_rate,omitempty"`
	// Average egress (outbound) rate, not including messages
	// that straight through to auto-acking consumers.
	AverageEgressRate float64 `json:"avg_egress_rate,omitempty"`
	// rate at which unacknowledged message records enter RAM,
	// e.g. because messages are delivered requiring acknowledgement
	AverageAckIngressRate float32 `json:"avg_ack_ingress_rate,omitempty"`
	// rate at which unacknowledged message records leave RAM,
	// e.g. because acks arrive or unacked messages are paged out
	AverageAckEgressRate float32 `json:"avg_ack_egress_rate,omitempty"`
}

BackingQueueStatus exposes backing queue (queue storage engine) metrics. They can change in a future version of RabbitMQ.

type BindingInfo

type BindingInfo struct {
	// Binding source (exchange name)
	Source string `json:"source"`
	Vhost  string `json:"vhost,omitempty"`
	// Binding destination (queue or exchange name)
	Destination string `json:"destination"`
	// Destination type, either "queue" or "exchange"
	DestinationType string                 `json:"destination_type"`
	RoutingKey      string                 `json:"routing_key"`
	Arguments       map[string]interface{} `json:"arguments"`
	PropertiesKey   string                 `json:"properties_key,omitempty"`
}

BindingInfo represents details of a binding.

type BindingVertex

type BindingVertex string

BindingVertex represents one end (vertex) of a binding, a source or destination. This is primarily relevant for exchange-to-exchange bindings (E2Es).

const (
	// BindingSource indicates the source vertex of a binding
	BindingSource BindingVertex = "source"
	// BindingDestination indicates the source vertex of a binding
	BindingDestination BindingVertex = "destination"
)

func (BindingVertex) String

func (v BindingVertex) String() string

type BriefChannelDetail

type BriefChannelDetail struct {
	ConnectionName string `json:"connection_name"`
	Name           string `json:"name"`
	Node           string `json:"node"`
	Number         int    `json:"number"`
	PeerHost       string `json:"peer_host"`
	PeerPort       Port   `json:"peer_port"`
	User           string `json:"user"`
}

BriefChannelDetail represents a channel with a limited number of metrics.

type BriefConnectionDetails

type BriefConnectionDetails struct {
	// Connection name
	Name string `json:"name"`
	// Client port
	PeerPort Port `json:"peer_port"`
	// Client host
	PeerHost string `json:"peer_host"`
}

BriefConnectionDetails represents a brief (very incomplete) subset of connection information.

type BriefQueueInfo

type BriefQueueInfo struct {
	Name  string `json:"name"`
	Vhost string `json:"vhost"`
}

BriefQueueInfo represents a fully qualified queue name.

type BrokerContext

type BrokerContext struct {
	Node        string `json:"node"`
	Description string `json:"description"`
	Path        string `json:"path"`
	Port        Port   `json:"port"`
	Ignore      bool   `json:"ignore_in_use"`
}

BrokerContext represents a context (Erlang application) running on a node a node

type ChannelDetails added in v2.11.0

type ChannelDetails struct {
	ConnectionName string `json:"connection_name"`
	Name           string `json:"name"`
	Node           string `json:"node"`
	Number         uint   `json:"number"`
	PeerHost       string `json:"peer_host"`
	PeerPort       Port   `json:"peer_port"`
	User           string `json:"user"`
}

ChannelDetails describe channel information with a consumer

func (*ChannelDetails) UnmarshalJSON added in v2.16.0

func (c *ChannelDetails) UnmarshalJSON(data []byte) error

Handles special case where `ChannelDetails` is an empty array See https://github.com/rabbitmq/rabbitmq-server/issues/2684

type ChannelInfo

type ChannelInfo struct {
	// Channel number
	Number int `json:"number"`
	// Channel name
	Name string `json:"name"`

	// basic.qos (prefetch count) value used
	PrefetchCount int `json:"prefetch_count"`
	// How many consumers does this channel have
	ConsumerCount int `json:"consumer_count"`

	// Number of unacknowledged messages on this channel
	UnacknowledgedMessageCount int `json:"messages_unacknowledged"`
	// Number of messages on this channel unconfirmed to publishers
	UnconfirmedMessageCount int `json:"messages_unconfirmed"`
	// Number of messages on this channel uncommited to message store
	UncommittedMessageCount int `json:"messages_uncommitted"`
	// Number of acks on this channel uncommited to message store
	UncommittedAckCount int `json:"acks_uncommitted"`

	// TODO(mk): custom deserializer to date/time?
	IdleSince string `json:"idle_since"`

	// True if this channel uses publisher confirms
	UsesPublisherConfirms bool `json:"confirm"`
	// True if this channel uses transactions
	Transactional bool `json:"transactional"`
	// True if this channel is blocked via channel.flow
	ClientFlowBlocked bool `json:"client_flow_blocked"`

	User  string `json:"user"`
	Vhost string `json:"vhost"`
	Node  string `json:"node"`

	ConnectionDetails BriefConnectionDetails `json:"connection_details"`
}

ChannelInfo represents an AMQP 0-9-1 channel.

type Client

type Client struct {
	// URI of a RabbitMQ node to use, not including the path, e.g. http://127.0.0.1:15672.
	Endpoint string
	// Username to use. This RabbitMQ user must have the "management" tag.
	Username string
	// Password to use.
	Password string
	// contains filtered or unexported fields
}

Client for interaction with RabbitMQ HTTP API.

func NewClient

func NewClient(uri string, username string, password string) (me *Client, err error)

NewClient instantiates a client.

func NewTLSClient

func NewTLSClient(uri string, username string, password string, transport http.RoundTripper) (me *Client, err error)

NewTLSClient instantiates a client with a transport; it is up to the developer to make that layer secure.

func (*Client) CancelSyncQueue

func (c *Client) CancelSyncQueue(vhost, queue string) (res *http.Response, err error)

CancelSyncQueue cancels queue synchronisation process.

func (*Client) ClearPermissionsIn

func (c *Client) ClearPermissionsIn(vhost, username string) (res *http.Response, err error)

ClearPermissionsIn clears (deletes) permissions of user in virtual host.

func (*Client) ClearTopicPermissionsIn

func (c *Client) ClearTopicPermissionsIn(vhost, username string) (res *http.Response, err error)

ClearTopicPermissionsIn clears (deletes) topic-permissions of user in virtual host.

func (*Client) CloseAllConnectionsOfUser added in v2.16.0

func (c *Client) CloseAllConnectionsOfUser(username string) (res *http.Response, err error)

CloseConnection closes a connection.

func (*Client) CloseConnection

func (c *Client) CloseConnection(name string) (res *http.Response, err error)

CloseConnection closes a connection.

func (*Client) DeclareBinding

func (c *Client) DeclareBinding(vhost string, info BindingInfo) (res *http.Response, err error)

DeclareBinding adds a new binding

func (*Client) DeclareExchange

func (c *Client) DeclareExchange(vhost, exchange string, info ExchangeSettings) (res *http.Response, err error)

DeclareExchange declares an exchange.

func (*Client) DeclareQueue

func (c *Client) DeclareQueue(vhost, queue string, info QueueSettings) (res *http.Response, err error)

DeclareQueue declares a queue.

func (*Client) DeclareShovel

func (c *Client) DeclareShovel(vhost, shovel string, info ShovelDefinition) (res *http.Response, err error)

DeclareShovel creates a shovel

func (*Client) DeleteAllRuntimeParameters added in v2.6.0

func (c *Client) DeleteAllRuntimeParameters() (err error)

DeleteAllRuntimeParameters clears all runtime parameters. Only mean to be used in integration tests.

func (*Client) DeleteBinding

func (c *Client) DeleteBinding(vhost string, info BindingInfo) (res *http.Response, err error)

DeleteBinding deletes an individual binding

func (*Client) DeleteExchange

func (c *Client) DeleteExchange(vhost, exchange string) (res *http.Response, err error)

DeleteExchange deletes an exchange.

func (*Client) DeleteFederationUpstream

func (c *Client) DeleteFederationUpstream(vhost, name string) (res *http.Response, err error)

DeleteFederationUpstream removes a federation upstream.

func (*Client) DeleteGlobalParameter added in v2.8.0

func (c *Client) DeleteGlobalParameter(name string) (res *http.Response, err error)

DeleteRuntimeParameter removes a runtime parameter.

func (*Client) DeleteOperatorPolicy added in v2.9.0

func (c *Client) DeleteOperatorPolicy(vhost, name string) (res *http.Response, err error)

DeleteOperatorPolicy deletes an operator policy.

func (*Client) DeletePolicy

func (c *Client) DeletePolicy(vhost, name string) (res *http.Response, err error)

DeletePolicy deletes a policy.

func (*Client) DeleteQueue

func (c *Client) DeleteQueue(vhost, queue string, opts ...QueueDeleteOptions) (res *http.Response, err error)

DeleteQueue deletes a queue.

func (*Client) DeleteRuntimeParameter added in v2.2.0

func (c *Client) DeleteRuntimeParameter(component, vhost, name string) (res *http.Response, err error)

DeleteRuntimeParameter removes a runtime parameter.

func (*Client) DeleteShovel

func (c *Client) DeleteShovel(vhost, shovel string) (res *http.Response, err error)

DeleteShovel a shovel

func (*Client) DeleteTopicPermissionsIn

func (c *Client) DeleteTopicPermissionsIn(vhost, username string, exchange string) (res *http.Response, err error)

DeleteTopicPermissionsIn delete topic-permissions of exchange for user in virtual host.

func (*Client) DeleteUser

func (c *Client) DeleteUser(username string) (res *http.Response, err error)

DeleteUser deletes a user by name.

func (*Client) DeleteUserLimits added in v2.12.0

func (c *Client) DeleteUserLimits(username string, limits UserLimits) (res *http.Response, err error)

DeleteUserLimits deletes limits of a user.

func (*Client) DeleteVhost

func (c *Client) DeleteVhost(vhostname string) (res *http.Response, err error)

DeleteVhost deletes a virtual host.

func (*Client) DeleteVhostLimits added in v2.11.0

func (c *Client) DeleteVhostLimits(vhostname string, limits VhostLimits) (res *http.Response, err error)

DeleteVhostLimits deletes limits of a virtual host.

func (*Client) EnableFeatureFlag added in v2.6.0

func (c *Client) EnableFeatureFlag(featureFlagName string) (res *http.Response, err error)

EnableFeatureFlag enables a feature flag.

func (*Client) EnabledProtocols

func (c *Client) EnabledProtocols() (xs []string, err error)

EnabledProtocols returns a list of names of the plugins enabled on target node.

func (*Client) GetAllUserLimits added in v2.12.0

func (c *Client) GetAllUserLimits() (rec []UserLimitsInfo, err error)

GetAllUserLimits gets all users limits.

func (*Client) GetAllVhostLimits added in v2.12.0

func (c *Client) GetAllVhostLimits() (rec []VhostLimitsInfo, err error)

GetAllVhostLimits gets all virtual hosts limits.

func (*Client) GetChannel

func (c *Client) GetChannel(name string) (rec *ChannelInfo, err error)

GetChannel returns channel information.

func (*Client) GetClusterName

func (c *Client) GetClusterName() (rec *ClusterName, err error)

GetClusterName returns current cluster name.

func (*Client) GetConnection

func (c *Client) GetConnection(name string) (rec *ConnectionInfo, err error)

GetConnection retrieves information about a connection.

func (*Client) GetExchange

func (c *Client) GetExchange(vhost, exchange string) (rec *DetailedExchangeInfo, err error)

GetExchange returns information about an exchange.

func (*Client) GetFederationUpstream added in v2.2.0

func (c *Client) GetFederationUpstream(vhost, name string) (up *FederationUpstream, err error)

GetFederationUpstream returns information about a federation upstream.

func (*Client) GetGlobalParameter added in v2.8.0

func (c *Client) GetGlobalParameter(name string) (p *GlobalRuntimeParameter, err error)

GetGlobalParameter returns information about a global parameter.

func (*Client) GetNode

func (c *Client) GetNode(name string) (rec *NodeInfo, err error)

GetNode return information about a node.

func (*Client) GetOperatorPolicy added in v2.9.0

func (c *Client) GetOperatorPolicy(vhost, name string) (rec *OperatorPolicy, err error)

GetOperatorPolicy returns individual operator policy in virtual host.

func (*Client) GetPermissionsIn

func (c *Client) GetPermissionsIn(vhost, username string) (rec PermissionInfo, err error)

GetPermissionsIn returns permissions of user in virtual host.

func (*Client) GetPolicy

func (c *Client) GetPolicy(vhost, name string) (rec *Policy, err error)

GetPolicy returns individual policy in virtual host.

func (*Client) GetQueue

func (c *Client) GetQueue(vhost, queue string) (rec *DetailedQueueInfo, err error)

GetQueue returns information about a queue.

func (*Client) GetQueueWithParameters

func (c *Client) GetQueueWithParameters(vhost, queue string, qs url.Values) (rec *DetailedQueueInfo, err error)

GetQueueWithParameters returns information about a queue. Compared to the regular GetQueue function, this one accepts additional query string values.

func (*Client) GetRuntimeParameter added in v2.2.0

func (c *Client) GetRuntimeParameter(component, vhost, name string) (p *RuntimeParameter, err error)

GetRuntimeParameter returns information about a runtime parameter.

func (*Client) GetShovel

func (c *Client) GetShovel(vhost, shovel string) (rec *ShovelInfo, err error)

GetShovel returns a shovel configuration

func (*Client) GetTopicPermissionsIn

func (c *Client) GetTopicPermissionsIn(vhost, username string) (rec []TopicPermissionInfo, err error)

GetTopicPermissionsIn returns topic-permissions of user in virtual host.

func (*Client) GetUser

func (c *Client) GetUser(username string) (rec *UserInfo, err error)

GetUser returns information about individual user.

func (*Client) GetUserLimits added in v2.12.0

func (c *Client) GetUserLimits(username string) (rec []UserLimitsInfo, err error)

GetUserLimits gets a user limits.

func (*Client) GetVhost

func (c *Client) GetVhost(vhostname string) (rec *VhostInfo, err error)

GetVhost returns information about a specific virtual host.

func (*Client) GetVhostLimits added in v2.11.0

func (c *Client) GetVhostLimits(vhostname string) (rec []VhostLimitsInfo, err error)

GetVhostLimits gets a virtual host limits.

func (*Client) HealthCheckAlarms added in v2.7.0

func (c *Client) HealthCheckAlarms() (rec ResourceAlarmCheckStatus, err error)

HealthCheckAlarms checks if there are resource alarms in effect in the cluster Related RabbitMQ doc guide: https://www.rabbitmq.com/alarms.html

func (*Client) HealthCheckCertificateExpiration added in v2.7.0

func (c *Client) HealthCheckCertificateExpiration(within uint, unit TimeUnit) (rec HealthCheckStatus, err error)

HealthCheckCertificateExpiration checks the expiration date on the certificates for every listener configured to use TLS. Valid units: days, weeks, months, years. The value of the within argument is the number of units. So, when within is 2 and unit is "months", the expiration period used by the check will be the next two months.

func (*Client) HealthCheckLocalAlarms added in v2.7.0

func (c *Client) HealthCheckLocalAlarms() (rec ResourceAlarmCheckStatus, err error)

HealthCheckLocalAlarms checks if there are resource alarms in effect on the target node Related RabbitMQ doc guide: https://www.rabbitmq.com/alarms.html

func (*Client) HealthCheckNodeIsMirrorSyncCritical added in v2.7.0

func (c *Client) HealthCheckNodeIsMirrorSyncCritical() (rec HealthCheckStatus, err error)

HealthCheckNodeIsMirrorSyncCritical checks if there are classic mirrored queues without synchronised mirrors online (queues that would potentially lose data if the target node is shut down).

func (*Client) HealthCheckNodeIsQuorumCritical added in v2.7.0

func (c *Client) HealthCheckNodeIsQuorumCritical() (rec HealthCheckStatus, err error)

HealthCheckNodeIsQuorumCritical checks if there are quorum queues with minimum online quorum (queues that would lose their quorum and availability if the target node is shut down). Relevant RabbitMQ doc guide: https://www.rabbitmq.com/quorum-queues.html

func (*Client) HealthCheckPortListener added in v2.7.0

func (c *Client) HealthCheckPortListener(port uint) (rec PortListenerCheckStatus, err error)

HealthCheckPortListener checks if there is an active listener on the give port. Relevant RabbitMQ doc guide: https://www.rabbitmq.com/monitoring.html

func (*Client) HealthCheckProtocolListener added in v2.7.0

func (c *Client) HealthCheckProtocolListener(protocol Protocol) (rec ProtocolListenerCheckStatus, err error)

HealthCheckProtocolListener checks if there is an active listener for the given protocol Valid protocol names are: amqp091, amqp10, mqtt, stomp, web-mqtt, web-stomp, http, https, clustering Relevant RabbitMQ doc guide: https://www.rabbitmq.com/monitoring.html

func (*Client) HealthCheckVirtualHosts added in v2.7.0

func (c *Client) HealthCheckVirtualHosts() (rec HealthCheckStatus, err error)

HealthCheckVirtualHosts checks if all virtual hosts are running on the target node

func (*Client) ListBindings

func (c *Client) ListBindings() (rec []BindingInfo, err error)

ListBindings returns all bindings

func (*Client) ListBindingsIn

func (c *Client) ListBindingsIn(vhost string) (rec []BindingInfo, err error)

ListBindingsIn returns all bindings in a virtual host.

func (*Client) ListChannels

func (c *Client) ListChannels() (rec []ChannelInfo, err error)

ListChannels returns information about all open channels.

func (*Client) ListConnections

func (c *Client) ListConnections() (rec []ConnectionInfo, err error)

ListConnections returns a list of client connections to target node.

func (*Client) ListConnectionsOfUser added in v2.16.0

func (c *Client) ListConnectionsOfUser(username string) (rec []UserConnectionInfo, err error)

ListConnections returns a list of client connections to target node.

func (*Client) ListConsumers

func (c *Client) ListConsumers() (rec []ConsumerInfo, err error)

ListConsumers lists all consumers in the cluster.

func (*Client) ListConsumersIn

func (c *Client) ListConsumersIn(vhost string) (rec []ConsumerInfo, err error)

ListConsumersIn lists all consumers in a virtual host.

func (*Client) ListDefinitions added in v2.7.0

func (c *Client) ListDefinitions() (p *ExportedDefinitions, err error)

ListDefinitions returns a set of definitions exported from a RabbitMQ cluster.

func (*Client) ListExchangeBindings

func (c *Client) ListExchangeBindings(vhost, exchange string, sourceOrDestination BindingVertex) (rec []BindingInfo, err error)

ListExchangeBindings returns all bindings having the exchange as source or destination as defined by the Target

func (*Client) ListExchangeBindingsBetween

func (c *Client) ListExchangeBindingsBetween(vhost, source string, destination string) (rec []BindingInfo, err error)

ListExchangeBindingsBetween returns a set of bindings between two exchanges.

func (*Client) ListExchangeBindingsWithDestination

func (c *Client) ListExchangeBindingsWithDestination(vhost, exchange string) (rec []BindingInfo, err error)

ListExchangeBindingsWithDestination returns exchange-to-exchange (E2E) bindings where the given exchange is the destination.

func (*Client) ListExchangeBindingsWithSource

func (c *Client) ListExchangeBindingsWithSource(vhost, exchange string) (rec []BindingInfo, err error)

ListExchangeBindingsWithSource returns exchange-to-exchange (E2E) bindings where the given exchange is the source.

func (*Client) ListExchanges

func (c *Client) ListExchanges() (rec []ExchangeInfo, err error)

ListExchanges lists all exchanges in a cluster. This only includes exchanges in the virtual hosts accessible to the user.

func (*Client) ListExchangesIn

func (c *Client) ListExchangesIn(vhost string) (rec []ExchangeInfo, err error)

ListExchangesIn lists all exchanges in a virtual host.

func (*Client) ListFeatureFlags added in v2.6.0

func (c *Client) ListFeatureFlags() (rec []FeatureFlag, err error)

ListFeatureFlags lists all feature flags.

func (c *Client) ListFederationLinks() (links FederationLinkMap, err error)

ListFederationLinks returns a list of all federation links.

func (*Client) ListFederationLinksIn added in v2.3.0

func (c *Client) ListFederationLinksIn(vhost string) (links FederationLinkMap, err error)

ListFederationLinksIn returns a list of federation links in a vhost.

func (*Client) ListFederationUpstreams added in v2.2.0

func (c *Client) ListFederationUpstreams() (ups []FederationUpstream, err error)

ListFederationUpstreams returns a list of all federation upstreams.

func (*Client) ListFederationUpstreamsIn added in v2.2.0

func (c *Client) ListFederationUpstreamsIn(vhost string) (ups []FederationUpstream, err error)

ListFederationUpstreamsIn returns a list of all federation upstreams in a vhost.

func (*Client) ListGlobalParameters added in v2.8.0

func (c *Client) ListGlobalParameters() (params []GlobalRuntimeParameter, err error)

ListGlobalParameters returns a list of all global parameters.

func (*Client) ListNodes

func (c *Client) ListNodes() (rec []NodeInfo, err error)

ListNodes returns a list of cluster nodes.

func (*Client) ListOperatorPolicies added in v2.9.0

func (c *Client) ListOperatorPolicies() (rec []OperatorPolicy, err error)

ListOperatorPolicies returns all operator policies (across all virtual hosts).

func (*Client) ListOperatorPoliciesIn added in v2.9.0

func (c *Client) ListOperatorPoliciesIn(vhost string) (rec []OperatorPolicy, err error)

ListOperatorPoliciesIn returns operator policies in a specific virtual host.

func (*Client) ListPermissions

func (c *Client) ListPermissions() (rec []PermissionInfo, err error)

ListPermissions returns permissions for all users and virtual hosts.

func (*Client) ListPermissionsOf

func (c *Client) ListPermissionsOf(username string) (rec []PermissionInfo, err error)

ListPermissionsOf returns permissions of a specific user.

func (*Client) ListPolicies

func (c *Client) ListPolicies() (rec []Policy, err error)

ListPolicies returns all policies (across all virtual hosts).

func (*Client) ListPoliciesIn

func (c *Client) ListPoliciesIn(vhost string) (rec []Policy, err error)

ListPoliciesIn returns policies in a specific virtual host.

func (*Client) ListQueueBindings

func (c *Client) ListQueueBindings(vhost, queue string) (rec []BindingInfo, err error)

ListQueueBindings returns all bindings of individual queue.

func (*Client) ListQueueBindingsBetween

func (c *Client) ListQueueBindingsBetween(vhost, exchange string, queue string) (rec []BindingInfo, err error)

ListQueueBindingsBetween returns a set of bindings between an exchange and a queue.

func (*Client) ListQueues

func (c *Client) ListQueues() (rec []QueueInfo, err error)

ListQueues lists all queues in the cluster. This only includes queues in the virtual hosts accessible to the user.

func (*Client) ListQueuesIn

func (c *Client) ListQueuesIn(vhost string) (rec []QueueInfo, err error)

ListQueuesIn lists all queues in a virtual host.

func (*Client) ListQueuesWithParameters

func (c *Client) ListQueuesWithParameters(params url.Values) (rec []QueueInfo, err error)

ListQueuesWithParameters lists queues with a list of query string values.

func (*Client) ListQueuesWithParametersIn added in v2.12.0

func (c *Client) ListQueuesWithParametersIn(vhost string, params url.Values) (rec []QueueInfo, err error)

ListQueuesWithParametersIs lists queues with a list of query string values in the vhost vhost.

func (*Client) ListRuntimeParameters added in v2.2.0

func (c *Client) ListRuntimeParameters() (params []RuntimeParameter, err error)

ListRuntimeParameters returns a list of all runtime parameters.

func (*Client) ListRuntimeParametersFor added in v2.2.0

func (c *Client) ListRuntimeParametersFor(component string) (params []RuntimeParameter, err error)

ListRuntimeParametersFor returns a list of all runtime parameters for a component in all vhosts.

func (*Client) ListRuntimeParametersIn added in v2.2.0

func (c *Client) ListRuntimeParametersIn(component, vhost string) (p []RuntimeParameter, err error)

ListRuntimeParametersIn returns a list of all runtime parameters for a component in a vhost.

func (*Client) ListShovelStatus added in v2.7.0

func (c *Client) ListShovelStatus(vhost string) (rec []ShovelStatus, err error)

ListShovelStatus returns status of all shovels in a vhost

func (*Client) ListShovels

func (c *Client) ListShovels() (rec []ShovelInfo, err error)

ListShovels returns all shovels

func (*Client) ListShovelsIn

func (c *Client) ListShovelsIn(vhost string) (rec []ShovelInfo, err error)

ListShovelsIn returns all shovels in a vhost

func (*Client) ListTopicPermissions

func (c *Client) ListTopicPermissions() (rec []TopicPermissionInfo, err error)

ListTopicPermissions returns topic-permissions for all users and virtual hosts.

func (*Client) ListTopicPermissionsOf

func (c *Client) ListTopicPermissionsOf(username string) (rec []TopicPermissionInfo, err error)

ListTopicPermissionsOf returns topic-permissions of a specific user.

func (*Client) ListUsers

func (c *Client) ListUsers() (rec []UserInfo, err error)

ListUsers returns a list of all users in a cluster.

func (*Client) ListVhostConnections added in v2.12.0

func (c *Client) ListVhostConnections(vhostname string) (rec []ConnectionInfo, err error)

ListVhostConnections returns the current connections to a specified vhost

func (*Client) ListVhostDefinitions added in v2.11.0

func (c *Client) ListVhostDefinitions(vhost string) (p *ExportedDefinitions, err error)

ListVhostDefinitions returns a set of definitions for a specific vhost.

func (*Client) ListVhosts

func (c *Client) ListVhosts() (rec []VhostInfo, err error)

ListVhosts returns a list of virtual hosts.

func (*Client) Overview

func (c *Client) Overview() (rec *Overview, err error)

Overview returns an overview of cluster state with some key aggregated metrics.

func (*Client) PagedListQueuesWithParameters

func (c *Client) PagedListQueuesWithParameters(params url.Values) (rec PagedQueueInfo, err error)

PagedListQueuesWithParameters lists queues with pagination.

func (*Client) PagedListQueuesWithParametersIn added in v2.12.0

func (c *Client) PagedListQueuesWithParametersIn(vhost string, params url.Values) (rec PagedQueueInfo, err error)

PagedListQueuesWithParameters lists queues with pagination in the vhost vhost.

func (*Client) ProtocolPorts

func (c *Client) ProtocolPorts() (res map[string]Port, err error)

ProtocolPorts returns a list of active (listening) ports on target node.

func (*Client) PurgeQueue

func (c *Client) PurgeQueue(vhost, queue string) (res *http.Response, err error)

PurgeQueue purges a queue (deletes all messages ready for delivery in it).

func (*Client) PutFederationUpstream

func (c *Client) PutFederationUpstream(vhost, name string, def FederationDefinition) (res *http.Response, err error)

PutFederationUpstream creates or updates a federation upstream configuration.

func (*Client) PutGlobalParameter added in v2.8.0

func (c *Client) PutGlobalParameter(name string, value interface{}) (res *http.Response, err error)

PutRuntimeParameter creates or updates a runtime parameter.

func (*Client) PutOperatorPolicy added in v2.9.0

func (c *Client) PutOperatorPolicy(vhost string, name string, operatorPolicy OperatorPolicy) (res *http.Response, err error)

PutOperatorPolicy creates or updates an operator policy.

func (*Client) PutPolicy

func (c *Client) PutPolicy(vhost string, name string, policy Policy) (res *http.Response, err error)

PutPolicy creates or updates a policy.

func (*Client) PutRuntimeParameter added in v2.2.0

func (c *Client) PutRuntimeParameter(component, vhost, name string, value interface{}) (res *http.Response, err error)

PutRuntimeParameter creates or updates a runtime parameter.

func (*Client) PutUser

func (c *Client) PutUser(username string, info UserSettings) (res *http.Response, err error)

PutUser updates information about an individual user.

func (*Client) PutUserLimits added in v2.12.0

func (c *Client) PutUserLimits(username string, limits UserLimitsValues) (res *http.Response, err error)

PutUserLimits puts limits of a user.

func (*Client) PutUserWithoutPassword

func (c *Client) PutUserWithoutPassword(username string, info UserSettings) (res *http.Response, err error)

PutUserWithoutPassword creates a passwordless user. Such users can only authenticate using an X.509 certificate or another authentication mechanism (or backend) that does not use passwords.

func (*Client) PutVhost

func (c *Client) PutVhost(vhostname string, settings VhostSettings) (res *http.Response, err error)

PutVhost creates or updates a virtual host.

func (*Client) PutVhostLimits added in v2.11.0

func (c *Client) PutVhostLimits(vhostname string, limits VhostLimitsValues) (res *http.Response, err error)

PutVhostLimits puts limits of a virtual host.

func (*Client) SetClusterName

func (c *Client) SetClusterName(cn ClusterName) (res *http.Response, err error)

SetClusterName sets cluster name.

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

SetTimeout changes the HTTP timeout that the Client will use. By default there is no timeout.

func (*Client) SetTransport

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

SetTransport changes the Transport Layer that the Client will use.

func (*Client) SyncQueue

func (c *Client) SyncQueue(vhost, queue string) (res *http.Response, err error)

SyncQueue synchronises queue contents with the mirrors remaining in the cluster.

func (*Client) UpdatePermissionsIn

func (c *Client) UpdatePermissionsIn(vhost, username string, permissions Permissions) (res *http.Response, err error)

UpdatePermissionsIn sets permissions of a user in a virtual host.

func (*Client) UpdateTopicPermissionsIn

func (c *Client) UpdateTopicPermissionsIn(vhost, username string, TopicPermissions TopicPermissions) (res *http.Response, err error)

UpdateTopicPermissionsIn updates topic-permissions of user in virtual host.

func (*Client) UploadDefinitions added in v2.12.0

func (c *Client) UploadDefinitions(p *ExportedDefinitions) (res *http.Response, err error)

UploadDefinitions uploads a set of definitions and returns an error indicating if the operation was a failure

func (*Client) UploadVhostDefinitions added in v2.16.0

func (c *Client) UploadVhostDefinitions(p *ExportedDefinitions, vhost string) (res *http.Response, err error)

UploadDefinitions uploads a set of definitions and returns an error indicating if the operation was a failure

func (*Client) Whoami

func (c *Client) Whoami() (rec *WhoamiInfo, err error)

Whoami echoes requesting user's name back.

type ClusterLink struct {
	Stats     ClusterLinkStats `json:"stats"`
	Name      string           `json:"name"`
	PeerAddr  string           `json:"peer_addr"`
	PeerPort  Port             `json:"peer_port"`
	SockAddr  string           `json:"sock_addr"`
	SockPort  Port             `json:"sock_port"`
	SendBytes uint64           `json:"send_bytes"`
	RecvBytes uint64           `json:"recv_bytes"`
}

ClusterLink is an inter-node communications link entity in clustering

type ClusterLinkStats added in v2.11.0

type ClusterLinkStats struct {
	SendBytes        uint64      `json:"send_bytes"`
	SendBytesDetails RateDetails `json:"send_bytes_details"`
	RecvBytes        uint64      `json:"recv_bytes"`
	RecvBytesDetails RateDetails `json:"recv_bytes_details"`
}

ClusterLinkStats is a stats field in ClusterLink

type ClusterName

type ClusterName struct {
	Name string `json:"name"`
}

ClusterName represents a RabbitMQ cluster name (identifier).

type ConnectionInfo

type ConnectionInfo struct {
	// Connection name
	Name string `json:"name"`
	// Node the client is connected to
	Node string `json:"node"`
	// Number of open channels
	Channels int `json:"channels"`
	// Connection state
	State string `json:"state"`
	// Connection type, network (via AMQP client) or direct (via direct Erlang client)
	Type string `json:"type"`

	// Server port
	Port Port `json:"port"`
	// Client port
	PeerPort Port `json:"peer_port"`

	// Server host
	Host string `json:"host"`
	// Client host
	PeerHost string `json:"peer_host"`

	// Last connection blocking reason, if any
	LastBlockedBy string `json:"last_blocked_by"`
	// When connection was last blocked
	LastBlockedAge string `json:"last_blocked_age"`

	// True if connection uses TLS/SSL
	UsesTLS bool `json:"ssl"`
	// Client certificate subject
	PeerCertSubject string `json:"peer_cert_subject"`
	// Client certificate validity
	PeerCertValidity string `json:"peer_cert_validity"`
	// Client certificate issuer
	PeerCertIssuer string `json:"peer_cert_issuer"`

	// TLS/SSL protocol and version
	SSLProtocol string `json:"ssl_protocol"`
	// Key exchange mechanism
	SSLKeyExchange string `json:"ssl_key_exchange"`
	// SSL cipher suite used
	SSLCipher string `json:"ssl_cipher"`
	// SSL hash
	SSLHash string `json:"ssl_hash"`

	// Protocol, e.g. AMQP 0-9-1 or MQTT 3-1
	Protocol string `json:"protocol"`
	User     string `json:"user"`
	// Virtual host
	Vhost string `json:"vhost"`

	// Heartbeat timeout
	Timeout int `json:"timeout"`
	// Maximum frame size (AMQP 0-9-1)
	FrameMax int `json:"frame_max"`

	// A map of client properties (name, version, capabilities, etc)
	ClientProperties Properties `json:"client_properties"`

	// Octets received
	RecvOct uint64 `json:"recv_oct"`
	// Octets sent
	SendOct     uint64 `json:"send_oct"`
	RecvCount   uint64 `json:"recv_cnt"`
	SendCount   uint64 `json:"send_cnt"`
	SendPending uint64 `json:"send_pend"`
	// Ingress data rate
	RecvOctDetails RateDetails `json:"recv_oct_details"`
	// Egress data rate
	SendOctDetails RateDetails `json:"send_oct_details"`

	// Connection timestamp
	ConnectedAt uint64 `json:"connected_at,omitempty"`
}

ConnectionInfo provides information about connection to a RabbitMQ node.

type ConsumerDetail added in v2.11.0

type ConsumerDetail struct {
	Arguments      map[string]interface{} `json:"arguments"`
	ChannelDetails ChannelDetails         `json:"channel_details"`
	AckRequired    bool                   `json:"ack_required"`
	Active         bool                   `json:"active"`
	ActiveStatus   string                 `json:"active_status"`
	ConsumerTag    string                 `json:"consumer_tag"`
	Exclusive      bool                   `json:"exclusive,omitempty"`
	PrefetchCount  uint                   `json:"prefetch_count"`
	Queue          QueueDetail            `json:"queue"`
}

ConsumerDetail describe consumer information with a queue

type ConsumerInfo

type ConsumerInfo struct {
	Arguments           map[string]interface{} `json:"arguments"`
	AcknowledgementMode AcknowledgementMode    `json:"ack_required"`
	ChannelDetails      BriefChannelDetail     `json:"channel_details"`
	ConsumerTag         string                 `json:"consumer_tag"`
	Exclusive           bool                   `json:"exclusive"`
	PrefetchCount       int                    `json:"prefetch_count"`
	Queue               BriefQueueInfo         `json:"queue"`
}

ConsumerInfo represents a consumer.

type DeleteAfter added in v2.5.0

type DeleteAfter string

DeleteAfter after can hold a delete-after value which may be a string (eg. "never") or an integer

func (DeleteAfter) MarshalJSON added in v2.5.0

func (d DeleteAfter) MarshalJSON() ([]byte, error)

MarshalJSON can marshal a string or an integer

func (*DeleteAfter) UnmarshalJSON added in v2.5.0

func (d *DeleteAfter) UnmarshalJSON(b []byte) error

UnmarshalJSON can unmarshal a string or an integer

type DetailedExchangeInfo

type DetailedExchangeInfo struct {
	Name       string                 `json:"name"`
	Vhost      string                 `json:"vhost"`
	Type       string                 `json:"type"`
	Durable    bool                   `json:"durable"`
	AutoDelete bool                   `json:"auto_delete"`
	Internal   bool                   `json:"internal"`
	Arguments  map[string]interface{} `json:"arguments"`

	Incoming     []ExchangeIngressDetails `json:"incoming"`
	Outgoing     []ExchangeEgressDetails  `json:"outgoing"`
	PublishStats IngressEgressStats       `json:"message_stats"`
}

DetailedExchangeInfo represents an exchange with all of its properties and metrics.

type DetailedQueueInfo

type DetailedQueueInfo QueueInfo

DetailedQueueInfo is an alias for QueueInfo

type ErlangApp

type ErlangApp NameDescriptionVersion

ErlangApp is an Erlang application running on a node.

type ErrorResponse

type ErrorResponse struct {
	StatusCode int
	Message    string `json:"error"`
	Reason     string `json:"reason"`
}

ErrorResponse represents an error reported by an API response.

func (ErrorResponse) Error

func (rme ErrorResponse) Error() string

type ExchangeEgressDetails

type ExchangeEgressDetails struct {
	Stats MessageStats `json:"stats"`
	Queue NameAndVhost `json:"queue"`
}

ExchangeEgressDetails represents egress (outbound) message flow metrics of an exchange.

type ExchangeInfo

type ExchangeInfo struct {
	Name       string                 `json:"name"`
	Vhost      string                 `json:"vhost,omitempty"`
	Type       string                 `json:"type"`
	Durable    bool                   `json:"durable"`
	AutoDelete AutoDelete             `json:"auto_delete"`
	Internal   bool                   `json:"internal"`
	Arguments  map[string]interface{} `json:"arguments"`

	MessageStats *IngressEgressStats `json:"message_stats,omitempty"`
}

ExchangeInfo represents and exchange and its properties.

type ExchangeIngressDetails

type ExchangeIngressDetails struct {
	Stats          MessageStats      `json:"stats"`
	ChannelDetails PublishingChannel `json:"channel_details"`
}

ExchangeIngressDetails represents ingress (inbound) message flow metrics of an exchange.

type ExchangeSettings

type ExchangeSettings struct {
	Type       string                 `json:"type"`
	Durable    bool                   `json:"durable"`
	AutoDelete bool                   `json:"auto_delete,omitempty"`
	Arguments  map[string]interface{} `json:"arguments,omitempty"`
}

ExchangeSettings is a set of exchange properties. Use this type when declaring an exchange.

type ExchangeType

type ExchangeType NameDescriptionEnabled

ExchangeType is an exchange type available on the node.

type ExportedDefinitions added in v2.7.0

type ExportedDefinitions struct {
	RabbitVersion    string                    `json:"rabbit_version,omitempty"`
	RabbitMQVersion  string                    `json:"rabbitmq_version,omitempty"`
	ProductName      string                    `json:"product_name,omitempty"`
	ProductVersion   string                    `json:"product_version,omitempty"`
	Users            *[]UserInfo               `json:"users,omitempty"`
	Vhosts           *[]VhostInfo              `json:"vhosts,omitempty"`
	Permissions      *[]Permissions            `json:"permissions,omitempty"`
	TopicPermissions *[]TopicPermissionInfo    `json:"topic_permissions,omitempty"`
	Parameters       *[]RuntimeParameter       `json:"paramaters,omitempty"`
	GlobalParameters *[]GlobalRuntimeParameter `json:"global_parameters,omitempty"`
	Policies         *[]PolicyDefinition       `json:"policies"`
	Queues           *[]QueueInfo              `json:"queues"`
	Exchanges        *[]ExchangeInfo           `json:"exchanges"`
	Bindings         *[]BindingInfo            `json:"bindings"`
}

ExportedDefinitions represents definitions exported from a RabbitMQ cluster

type FeatureFlag added in v2.6.0

type FeatureFlag struct {
	Name string `json:"name"`
	// Desc is the description of the feature flag.
	Desc string `json:"desc,omitempty"`
	// DocURL is the URL to a webpage to learn more about the feature flag.
	DocURL    string    `json:"doc_url,omitempty"`
	State     State     `json:"state,omitempty"`
	Stability Stability `json:"stability,omitempty"`
	// ProvidedBy is the RabbitMQ component or plugin which provides the feature flag.
	ProvidedBy string `json:"provided_by,omitempty"`
}

FeatureFlag represents a feature flag. Feature flags are a mechanism that controls what features are considered to be enabled or available on all cluster nodes. If a FeatureFlag is enabled so is its associated feature (or behavior). If not then all nodes in the cluster will disable the feature (behavior).

type FederationDefinition

type FederationDefinition struct {
	Uri            URISet `json:"uri"`
	Expires        int    `json:"expires,omitempty"`
	MessageTTL     int32  `json:"message-ttl,omitempty"`
	MaxHops        int    `json:"max-hops,omitempty"`
	PrefetchCount  int    `json:"prefetch-count,omitempty"`
	ReconnectDelay int    `json:"reconnect-delay"`
	AckMode        string `json:"ack-mode,omitempty"`
	TrustUserId    bool   `json:"trust-user-id"`
	Exchange       string `json:"exchange,omitempty"`
	Queue          string `json:"queue,omitempty"`
}

FederationDefinition represents settings that will be used by federation links.

type FederationLinkMap added in v2.13.0

type FederationLinkMap = []map[string]interface{}

type FederationUpstream

type FederationUpstream struct {
	Name       string               `json:"name"`
	Vhost      string               `json:"vhost"`
	Component  string               `json:"component"`
	Definition FederationDefinition `json:"value"`
}

FederationUpstream represents a configured federation upstream.

type GarbageCollectionDetails added in v2.11.0

type GarbageCollectionDetails struct {
	FullSweepAfter  int `json:"fullsweep_after"`
	MaxHeapSize     int `json:"max_heap_size"`
	MinBinVheapSize int `json:"min_bin_vheap_size"`
	MinHeapSize     int `json:"min_heap_size"`
	MinorGCs        int `json:"minor_gcs"`
}

GarbageCollectionDetail describe queue garbage collection information

type GlobalRuntimeParameter added in v2.7.0

type GlobalRuntimeParameter struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

GlobalRuntimeParameter represents a vhost-scoped parameter. Value is interface{} to support creating parameters directly from types such as FederationUpstream and ShovelInfo.

type HashingAlgorithm

type HashingAlgorithm string

HashingAlgorithm represents a hashing algorithm used by RabbitMQ's an internal authentication backend.

const (
	// HashingAlgorithmSHA256 sets password hashing algorithm to SHA-256.
	HashingAlgorithmSHA256 HashingAlgorithm = "rabbit_password_hashing_sha256"
	// HashingAlgorithmSHA512 sets password hashing algorithm to SHA-512.
	HashingAlgorithmSHA512 HashingAlgorithm = "rabbit_password_hashing_sha512"

	// HashingAlgorithmMD5 provided to support responses that include users created
	// before RabbitMQ 3.6 and other legacy scenarios. This algorithm is
	// deprecated.
	HashingAlgorithmMD5 HashingAlgorithm = "rabbit_password_hashing_md5"
)

func (HashingAlgorithm) String

func (algo HashingAlgorithm) String() string

type HealthCheck added in v2.7.0

type HealthCheck interface {
	// Returns true if the check is ok, otherwise false
	Ok() bool
}

HealthCheck represents a generic health check endpoint response Related RabbitMQ doc guide: https://www.rabbitmq.com/monitoring.html

type HealthCheckStatus added in v2.7.0

type HealthCheckStatus struct {
	HealthCheck
	Status string `json:"status"`
	Reason string `json:"reason,omitempty"`
}

HealthCheckStatus represents a generic health check endpoint response Related RabbitMQ doc guide: https://www.rabbitmq.com/monitoring.html

func (*HealthCheckStatus) Ok added in v2.7.0

func (h *HealthCheckStatus) Ok() bool

Ok returns true if the health check succeeded

type IngressEgressStats

type IngressEgressStats struct {
	PublishIn        int          `json:"publish_in,omitempty"`
	PublishInDetails *RateDetails `json:"publish_in_details,omitempty"`

	PublishOut        int          `json:"publish_out,omitempty"`
	PublishOutDetails *RateDetails `json:"publish_out_details,omitempty"`
}

IngressEgressStats represents common message flow metrics.

type Listener

type Listener struct {
	Node      string `json:"node"`
	Protocol  string `json:"protocol"`
	IpAddress string `json:"ip_address"`
	Port      Port   `json:"port"`
}

Listener represents a TCP listener on a node.

type MessageStats

type MessageStats struct {
	Publish                 int64       `json:"publish"`
	PublishDetails          RateDetails `json:"publish_details"`
	Deliver                 int64       `json:"deliver"`
	DeliverDetails          RateDetails `json:"deliver_details"`
	DeliverNoAck            int64       `json:"deliver_noack"`
	DeliverNoAckDetails     RateDetails `json:"deliver_noack_details"`
	DeliverGet              int64       `json:"deliver_get"`
	DeliverGetDetails       RateDetails `json:"deliver_get_details"`
	Redeliver               int64       `json:"redeliver"`
	RedeliverDetails        RateDetails `json:"redeliver_details"`
	Get                     int64       `json:"get"`
	GetDetails              RateDetails `json:"get_details"`
	GetNoAck                int64       `json:"get_no_ack"`
	GetNoAckDetails         RateDetails `json:"get_no_ack_details"`
	Ack                     int64       `json:"ack"`
	AckDetails              RateDetails `json:"ack_details"`
	ReturnUnroutable        int64       `json:"return_unroutable"`
	ReturnUnroutableDetails RateDetails `json:"return_unroutable_details"`
	DropUnroutable          int64       `json:"drop_unroutable"`
	DropUnroutableDetails   RateDetails `json:"drop_unroutable_details"`
}

MessageStats fields repsent a number of metrics related to published messages

type MetricsGCQueueLength added in v2.11.0

type MetricsGCQueueLength struct {
	ConnectionClosed       int `json:"connection_closed"`
	ChannelClosed          int `json:"channel_closed"`
	ConsumerDeleted        int `json:"consumer_deleted"`
	ExchangeDeleted        int `json:"exchange_deleted"`
	QueueDeleted           int `json:"queue_deleted"`
	VhostDeleted           int `json:"vhost_deleted"`
	NodeNodeDeleted        int `json:"node_node_deleted"`
	ChannelConsumerDeleted int `json:"channel_consumer_deleted"`
}

MetricsGCQueueLength is metrics of gc queuue length

type NameAndVhost

type NameAndVhost struct {
	Name  string `json:"name"`
	Vhost string `json:"vhost"`
}

NameAndVhost repesents a named entity in a virtual host.

type NameDescriptionEnabled

type NameDescriptionEnabled struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Enabled     bool   `json:"enabled"`
}

NameDescriptionEnabled represents a named entity with a description.

type NameDescriptionVersion

type NameDescriptionVersion struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
}

NameDescriptionVersion represents a named, versioned entity.

type NodeInfo

type NodeInfo struct {
	Name      string `json:"name"`
	NodeType  string `json:"type"`
	IsRunning bool   `json:"running"`
	OsPid     OsPid  `json:"os_pid"`

	FdUsed                  int         `json:"fd_used"`
	FdUsedDetails           RateDetails `json:"fd_used_details"`
	FdTotal                 int         `json:"fd_total"`
	ProcUsed                int         `json:"proc_used"`
	ProcUsedDetails         RateDetails `json:"proc_used_details"`
	ProcTotal               int         `json:"proc_total"`
	SocketsUsed             int         `json:"sockets_used"`
	SocketsUsedDetails      RateDetails `json:"sockets_used_details"`
	SocketsTotal            int         `json:"sockets_total"`
	MemUsed                 int         `json:"mem_used"`
	MemUsedDetails          RateDetails `json:"mem_used_details"`
	MemLimit                int         `json:"mem_limit"`
	MemAlarm                bool        `json:"mem_alarm"`
	DiskFree                int         `json:"disk_free"`
	DiskFreeDetails         RateDetails `json:"disk_free_details"`
	DiskFreeLimit           int         `json:"disk_free_limit"`
	DiskFreeAlarm           bool        `json:"disk_free_alarm"`
	GCNum                   uint64      `json:"gc_num"`
	GCNumDetails            RateDetails `json:"gc_num_details"`
	GCBytesReclaimed        uint64      `json:"gc_bytes_reclaimed"`
	GCBytesReclaimedDetails RateDetails `json:"gc_bytes_reclaimed_details"`
	ContextSwitches         uint64      `json:"context_switches"`
	ContextSwitchesDetails  RateDetails `json:"context_switches_details"`

	ConnectionCreated        uint64      `json:"connection_created"`
	ConnectionCreatedDetails RateDetails `json:"connection_created_details"`
	ConnectionClosed         uint64      `json:"connection_closed"`
	ConnectionClosedDetails  RateDetails `json:"connection_closed_details"`
	ChannelCreated           uint64      `json:"channel_created"`
	ChannelCreatedDetails    RateDetails `json:"channel_created_details"`
	ChannelClosed            uint64      `json:"channel_closed"`
	ChannelClosedDetails     RateDetails `json:"channel_closed_details"`
	QueueDeclared            uint64      `json:"queue_declared"`
	QueueDeclaredDetails     RateDetails `json:"queue_declared_details"`
	QueueCreated             uint64      `json:"queue_created"`
	QueueCreatedDetails      RateDetails `json:"queue_created_details"`
	QueueDeleted             uint64      `json:"queue_deleted"`
	QueueDeletedDetails      RateDetails `json:"queue_deleted_details"`

	IOReadCount                         uint64      `json:"io_read_count"`
	IOReadCountDetails                  RateDetails `json:"io_read_count_details"`
	IOReadBytes                         uint64      `json:"io_read_bytes"`
	IOReadBytesDetails                  RateDetails `json:"io_read_bytes_details"`
	IOReadAvgTime                       float64     `json:"io_read_avg_time"`
	IOReadAvgTimeDetails                RateDetails `json:"io_read_avg_time_details"`
	IOWriteCount                        uint64      `json:"io_write_count"`
	IOWriteCountDetails                 RateDetails `json:"io_write_count_details"`
	IOWriteBytes                        uint64      `json:"io_write_bytes"`
	IOWriteBytesDetails                 RateDetails `json:"io_write_bytes_details"`
	IOWriteAvgTime                      float64     `json:"io_write_avg_time"`
	IOWriteAvgTimeDetails               RateDetails `json:"io_write_avg_time_details"`
	IOSyncCount                         uint64      `json:"io_sync_count"`
	IOSyncCountDetails                  RateDetails `json:"io_sync_count_details"`
	IOSyncAvgTime                       float64     `json:"io_sync_avg_time"`
	IOSyncAvgTimeDetails                RateDetails `json:"io_sync_avg_time_details"`
	IOSeekCount                         uint64      `json:"io_seek_count"`
	IOSeekCountDetails                  RateDetails `json:"io_seek_count_details"`
	IOSeekAvgTime                       float64     `json:"io_seek_avg_time"`
	IOSeekAvgTimeDetails                RateDetails `json:"io_seek_avg_time_details"`
	IOReopenCount                       uint64      `json:"io_reopen_count"`
	IOReopenCountDetails                RateDetails `json:"io_reopen_count_details"`
	IOFileHandleOpenAttemptCount        uint64      `json:"io_file_handle_open_attempt_count"`
	IOFileHandleOpenAttemptCountDetails RateDetails `json:"io_file_handle_open_attempt_count_details"`

	MnesiaRAMTxCount uint64 `json:"mnesia_ram_tx_count"`

	MnesiaRAMTxCountDetails            RateDetails `json:"mnesia_ram_tx_count_details"`
	MnesiaDiskTxCount                  uint64      `json:"mnesia_disk_tx_count"`
	MnesiaDiskTxCountDetails           RateDetails `json:"mnesia_disk_tx_count_details"`
	MsgStoreReadCount                  uint64      `json:"msg_store_read_count"`
	MsgStoreReadCountDetails           RateDetails `json:"msg_store_read_count_details"`
	MsgStoreWriteCount                 uint64      `json:"msg_store_write_count"`
	MsgStoreWriteCountDetails          RateDetails `json:"msg_store_write_count_details"`
	QueueIndexJournalWriteCount        uint64      `json:"queue_index_journal_write_count"`
	QueueIndexJournalWriteCountDetails RateDetails `json:"queue_index_journal_write_count_details"`
	QueueIndexWriteCount               uint64      `json:"queue_index_write_count"`
	QueueIndexWriteCountDetails        RateDetails `json:"queue_index_write_count_details"`
	QueueIndexReadCount                uint64      `json:"queue_index_read_count"`
	QueueIndexReadCountDetails         RateDetails `json:"queue_index_read_count_details"`

	// Erlang scheduler run queue length
	RunQueueLength uint32 `json:"run_queue"`
	Processors     uint32 `json:"processors"`
	Uptime         uint64 `json:"uptime"`

	ExchangeTypes  []ExchangeType  `json:"exchange_types"`
	AuthMechanisms []AuthMechanism `json:"auth_mechanisms"`
	ErlangApps     []ErlangApp     `json:"applications"`
	Contexts       []BrokerContext `json:"contexts"`

	Partitions []string `json:"partitions"`

	ClusterLinks []ClusterLink `json:"cluster_links"`

	MetricsGCQueueLength MetricsGCQueueLength `json:"metrics_gc_queue_length"`
}

NodeInfo describes a RabbitMQ node and its basic metrics (such as resource usage).

type NodeNames

type NodeNames []string

NodeNames is a list of node names.

type ObjectTotals

type ObjectTotals struct {
	Consumers   int `json:"consumers"`
	Queues      int `json:"queues"`
	Exchanges   int `json:"exchanges"`
	Connections int `json:"connections"`
	Channels    int `json:"channels"`
}

ObjectTotals represents object (connections, queues, consumers, etc) metrics across the entire cluster.

type OperatorPolicy added in v2.9.0

type OperatorPolicy struct {
	// Virtual host this policy is in.
	Vhost string `json:"vhost"`
	// Regular expression pattern used to match queues,
	// , e.g. "^ha\..+"
	Pattern string `json:"pattern"`
	// What this policy applies to: "queues".
	ApplyTo  string `json:"apply-to"`
	Name     string `json:"name"`
	Priority int    `json:"priority"`
	// Additional arguments added to the queues that match a operator policy
	Definition PolicyDefinition `json:"definition"`
}

OperatorPolicy represents a configured policy.

type OsPid

type OsPid string

OsPid is an operating system process ID.

type Overview

type Overview struct {
	ManagementVersion string          `json:"management_version"`
	StatisticsLevel   string          `json:"statistics_level"`
	RabbitMQVersion   string          `json:"rabbitmq_version"`
	ErlangVersion     string          `json:"erlang_version"`
	FullErlangVersion string          `json:"erlang_full_version"`
	ExchangeTypes     []ExchangeType  `json:"exchange_types"`
	MessageStats      MessageStats    `json:"message_stats"`
	QueueTotals       QueueTotals     `json:"queue_totals"`
	ObjectTotals      ObjectTotals    `json:"object_totals"`
	Node              string          `json:"node"`
	StatisticsDBNode  string          `json:"statistics_db_node"`
	Listeners         []Listener      `json:"listeners"`
	Contexts          []BrokerContext `json:"contexts"`
}

Overview provides a point-in-time overview of cluster state and some of its key aggregated metrics.

type OwnerPidDetails

type OwnerPidDetails struct {
	Name     string `json:"name,omitempty"`
	PeerPort Port   `json:"peer_port,omitempty"`
	PeerHost string `json:"peer_host,omitempty"`
}

OwnerPidDetails describes an exclusive queue owner (connection).

type PagedQueueInfo

type PagedQueueInfo struct {
	Page          int         `json:"page"`
	PageCount     int         `json:"page_count"`
	PageSize      int         `json:"page_size"`
	FilteredCount int         `json:"filtered_count"`
	ItemCount     int         `json:"item_count"`
	TotalCount    int         `json:"total_count"`
	Items         []QueueInfo `json:"items"`
}

PagedQueueInfo is additional context returned for paginated requests.

type PermissionInfo

type PermissionInfo struct {
	User  string `json:"user"`
	Vhost string `json:"vhost"`

	// Configuration permissions
	Configure string `json:"configure"`
	// Write permissions
	Write string `json:"write"`
	// Read permissions
	Read string `json:"read"`
}

PermissionInfo represents a user's permission in a virtual host.

type Permissions

type Permissions struct {
	Configure string `json:"configure"`
	Write     string `json:"write"`
	Read      string `json:"read"`
}

Permissions represents permissions of a user in a virtual host. Use this type to set permissions of the user.

type Policy

type Policy struct {
	// Virtual host this policy is in.
	Vhost string `json:"vhost"`
	// Regular expression pattern used to match queues and exchanges,
	// , e.g. "^ha\..+"
	Pattern string `json:"pattern"`
	// What this policy applies to: "queues", "exchanges", etc.
	ApplyTo  string `json:"apply-to"`
	Name     string `json:"name"`
	Priority int    `json:"priority"`
	// Additional arguments added to the entities (queues,
	// exchanges or both) that match a policy
	Definition PolicyDefinition `json:"definition"`
}

Policy represents a configured policy.

type PolicyDefinition

type PolicyDefinition map[string]interface{}

PolicyDefinition is a map of additional arguments added to the entities (queues, exchanges or both) that match a policy.

type Port

type Port int

Port used by RabbitMQ or clients

func (*Port) UnmarshalJSON

func (p *Port) UnmarshalJSON(b []byte) error

UnmarshalJSON deserialises a port that can be an integer or string

type PortListenerCheckStatus added in v2.7.0

type PortListenerCheckStatus struct {
	HealthCheck
	Status  string `json:"status"`
	Reason  string `json:"reason,omitempty"`
	Port    uint   `json:"port,omitempty"`
	Missing uint   `json:"missing,omitempty"`
	Ports   []uint `json:"ports,omitempty"`
}

PortListenerCheckStatus represents the response from HealthCheckPortListener

func (*PortListenerCheckStatus) Ok added in v2.7.0

func (h *PortListenerCheckStatus) Ok() bool

Ok returns true if the health check succeeded

type Properties

type Properties map[string]interface{}

Properties are extra arguments as a map (on queues, bindings, etc)

type Protocol added in v2.7.0

type Protocol string
const (
	AMQP    Protocol = "amqp"
	AMQPS   Protocol = "amqp/ssl"
	AMQP091 Protocol = "amqp091"
	AMQP10  Protocol = "amqp10"

	MQTT       Protocol = "mqtt"
	STOMP      Protocol = "stomp"
	WebMQTT    Protocol = "web-mqtt"
	WebSTOMP   Protocol = "web-stomp"
	HTTP       Protocol = "http"
	HTTPS      Protocol = "https"
	Prometheus Protocol = "http/prometheus"
	Clustering Protocol = "clustering"
)

type ProtocolListenerCheckStatus added in v2.7.0

type ProtocolListenerCheckStatus struct {
	HealthCheck
	Status    string   `json:"status"`
	Reason    string   `json:"reason,omitempty"`
	Missing   string   `json:"missing,omitempty"`
	Protocols []string `json:"protocols,omitempty"`
}

ProtocolListenerCheckStatus represents the response from HealthCheckProtocolListener

func (*ProtocolListenerCheckStatus) Ok added in v2.7.0

Ok returns true if the health check succeeded

type PublishingChannel

type PublishingChannel struct {
	Number         int    `json:"number"`
	Name           string `json:"name"`
	ConnectionName string `json:"connection_name"`
	PeerPort       Port   `json:"peer_port"`
	PeerHost       string `json:"peer_host"`
}

PublishingChannel represents a channel and its basic properties.

type QueueDeleteOptions added in v2.7.0

type QueueDeleteOptions struct {
	// Only delete the queue if there are no messages.
	IfEmpty bool
	// Only delete the queue if there are no consumers.
	IfUnused bool
}

Options for deleting a queue. Use it with DeleteQueue.

type QueueDetail added in v2.11.0

type QueueDetail struct {
	Name  string `json:"name"`
	Vhost string `json:"vhost,omitempty"`
}

QueueDetail describe queue information with a consumer

type QueueInfo

type QueueInfo struct {
	// Queue name
	Name string `json:"name"`
	// Queue type
	Type string `json:"type,omitempty"`
	// Virtual host this queue belongs to
	Vhost string `json:"vhost,omitempty"`
	// Is this queue durable?
	Durable bool `json:"durable"`
	// Is this queue auto-deleted?
	AutoDelete AutoDelete `json:"auto_delete"`
	// Is this queue exclusive?
	Exclusive bool `json:"exclusive,omitempty"`
	// Extra queue arguments
	Arguments map[string]interface{} `json:"arguments"`

	// RabbitMQ node that hosts the leader replica for this queue
	Node string `json:"node,omitempty"`
	// Queue status
	Status string `json:"state,omitempty"`
	// Queue leader when it is quorum queue
	Leader string `json:"leader,omitempty"`
	// Queue members when it is quorum queue
	Members []string `json:"members,omitempty"`
	// Queue online members when it is quorum queue
	Online []string `json:"online,omitempty"`

	// Total amount of RAM used by this queue
	Memory int64 `json:"memory,omitempty"`
	// How many consumers this queue has
	Consumers int `json:"consumers,omitempty"`
	// Detail information of consumers
	ConsumerDetails *[]ConsumerDetail `json:"consumer_details,omitempty"`
	// Utilisation of all the consumers
	ConsumerUtilisation float64 `json:"consumer_utilisation,omitempty"`
	// If there is an exclusive consumer, its consumer tag
	ExclusiveConsumerTag string `json:"exclusive_consumer_tag,omitempty"`

	// GarbageCollection metrics
	GarbageCollection *GarbageCollectionDetails `json:"garbage_collection,omitempty"`

	// Policy applied to this queue, if any
	Policy string `json:"policy,omitempty"`

	// Total bytes of messages in this queues
	MessagesBytes               int64 `json:"message_bytes,omitempty"`
	MessagesBytesPersistent     int64 `json:"message_bytes_persistent,omitempty"`
	MessagesBytesRAM            int64 `json:"message_bytes_ram,omitempty"`
	MessagesBytesReady          int64 `json:"message_bytes_ready,omitempty"`
	MessagesBytesUnacknowledged int64 `json:"message_bytes_unacknowledged,omitempty"`

	// Total number of messages in this queue
	Messages           int          `json:"messages,omitempty"`
	MessagesDetails    *RateDetails `json:"messages_details,omitempty"`
	MessagesPersistent int          `json:"messages_persistent,omitempty"`
	MessagesRAM        int          `json:"messages_ram,omitempty"`

	// Number of messages ready to be delivered
	MessagesReady        int          `json:"messages_ready,omitempty"`
	MessagesReadyDetails *RateDetails `json:"messages_ready_details,omitempty"`

	// Number of messages delivered and pending acknowledgements from consumers
	MessagesUnacknowledged        int          `json:"messages_unacknowledged,omitempty"`
	MessagesUnacknowledgedDetails *RateDetails `json:"messages_unacknowledged_details,omitempty"`

	MessageStats *MessageStats `json:"message_stats,omitempty"`

	OwnerPidDetails *OwnerPidDetails `json:"owner_pid_details,omitempty"`

	BackingQueueStatus *BackingQueueStatus `json:"backing_queue_status,omitempty"`

	ActiveConsumers int64 `json:"active_consumers,omitempty"`
}

QueueInfo represents a queue, its properties and key metrics.

type QueueSettings

type QueueSettings struct {
	Type       string                 `json:"type"`
	Durable    bool                   `json:"durable"`
	AutoDelete bool                   `json:"auto_delete,omitempty"`
	Arguments  map[string]interface{} `json:"arguments,omitempty"`
}

QueueSettings represents queue properties. Use it to declare a queue.

type QueueTotals

type QueueTotals struct {
	Messages        int         `json:"messages"`
	MessagesDetails RateDetails `json:"messages_details"`

	MessagesReady        int         `json:"messages_ready"`
	MessagesReadyDetails RateDetails `json:"messages_ready_details"`

	MessagesUnacknowledged        int         `json:"messages_unacknowledged"`
	MessagesUnacknowledgedDetails RateDetails `json:"messages_unacknowledged_details"`
}

QueueTotals represents queue metrics across the entire cluster.

type RateDetailSample

type RateDetailSample struct {
	Sample    int64 `json:"sample"`
	Timestamp int64 `json:"timestamp"`
}

RateDetailSample single touple

type RateDetails

type RateDetails struct {
	Rate    float32            `json:"rate"`
	Samples []RateDetailSample `json:"samples"`
}

RateDetails fields represent rate of change of a numerical value

type ResourceAlarmCheckStatus added in v2.7.0

type ResourceAlarmCheckStatus struct {
	HealthCheck
	Status string          `json:"status"`
	Reason string          `json:"reason,omitempty"`
	Alarms []AlarmInEffect `json:"alarms,omitempty"`
}

ResourceAlarmCheckStatus represents the response from HealthCheckALarms

func (*ResourceAlarmCheckStatus) Ok added in v2.7.0

Ok returns true if the health check succeeded

type RuntimeParameter added in v2.2.0

type RuntimeParameter struct {
	Name      string      `json:"name"`
	Vhost     string      `json:"vhost"`
	Component string      `json:"component"`
	Value     interface{} `json:"value"`
}

RuntimeParameter represents a vhost-scoped runtime parameter. Value is interface{} to support creating parameters directly from types such as FederationUpstream and ShovelInfo.

type RuntimeParameterValue added in v2.2.0

type RuntimeParameterValue map[string]interface{}

RuntimeParameterValue represents arbitrary parameter data.

type ShovelDefinition

type ShovelDefinition struct {
	DestinationURI URISet `json:"dest-uri"`
	SourceURI      URISet `json:"src-uri"`

	AckMode                          string                 `json:"ack-mode,omitempty"`
	AddForwardHeaders                bool                   `json:"add-forward-headers,omitempty"`
	DeleteAfter                      DeleteAfter            `json:"delete-after,omitempty"`
	DestinationAddForwardHeaders     bool                   `json:"dest-add-forward-headers,omitempty"`
	DestinationAddTimestampHeader    bool                   `json:"dest-add-timestamp-header,omitempty"`
	DestinationAddress               string                 `json:"dest-address,omitempty"`
	DestinationApplicationProperties map[string]interface{} `json:"dest-application-properties,omitempty"`
	DestinationExchange              string                 `json:"dest-exchange,omitempty"`
	DestinationExchangeKey           string                 `json:"dest-exchange-key,omitempty"`
	DestinationProperties            map[string]interface{} `json:"dest-properties,omitempty"`
	DestinationProtocol              string                 `json:"dest-protocol,omitempty"`
	DestinationPublishProperties     map[string]interface{} `json:"dest-publish-properties,omitempty"`
	DestinationQueue                 string                 `json:"dest-queue,omitempty"`
	DestinationQueueArgs             map[string]interface{} `json:"dest-queue-args,omitempty"`
	DestinationMessageAnnotations    map[string]interface{} `json:"dest-message-annotations,omitempty"`
	PrefetchCount                    int                    `json:"prefetch-count,omitempty"`
	ReconnectDelay                   int                    `json:"reconnect-delay,omitempty"`
	SourceAddress                    string                 `json:"src-address,omitempty"`
	SourceDeleteAfter                DeleteAfter            `json:"src-delete-after,omitempty"`
	SourceExchange                   string                 `json:"src-exchange,omitempty"`
	SourceExchangeKey                string                 `json:"src-exchange-key,omitempty"`
	SourcePrefetchCount              int                    `json:"src-prefetch-count,omitempty"`
	SourceProtocol                   string                 `json:"src-protocol,omitempty"`
	SourceQueue                      string                 `json:"src-queue,omitempty"`
	SourceQueueArgs                  map[string]interface{} `json:"src-queue-args,omitempty"`
	SourceConsumerArgs               map[string]interface{} `json:"src-consumer-args,omitempty"`
}

ShovelDefinition contains the details of the shovel configuration

type ShovelDefinitionDTO

type ShovelDefinitionDTO struct {
	Definition ShovelDefinition `json:"value"`
}

ShovelDefinitionDTO provides a data transfer object

type ShovelInfo

type ShovelInfo struct {
	// Shovel name
	Name string `json:"name"`
	// Virtual host this Shovel belongs to
	Vhost string `json:"vhost"`
	// Runtime component of the Shovel
	Component string `json:"component"`
	// Details the configuration values of the Shovel
	Definition ShovelDefinition `json:"value"`
}

ShovelInfo contains the configuration of a dynamic Shovel

type ShovelStatus added in v2.7.0

type ShovelStatus struct {
	// Shovel name
	Name string `json:"name"`
	// Virtual host this shovel belongs to
	Vhost string `json:"vhost"`
	// Type of this shovel
	Type string `json:"type"`
	// State of this shovel
	State string `json:"state"`
	// Timestamp is the moment when this Shovel last reported its state change (e.g. was started)
	Timestamp string `json:"timestamp"`
}

ShovelStatus represents the status of a Shovel

type Stability added in v2.6.0

type Stability string

Stability status of a feature flag

const (
	// StabilityStable means a feature flag enables a fully supported feature
	StabilityStable Stability = "stable"
	// StabilityExperimental means a feature flag enables an experimental feature
	StabilityExperimental Stability = "experimental"
)

type State added in v2.6.0

type State string

State is an enumeration for supported feature flag states

const (
	// StateEnabled means that the flag is enabled
	StateEnabled State = "enabled"
	// StateDisabled means that the flag is disabled
	StateDisabled State = "disabled"
	// StateUnsupported means that one or more nodes in the cluster do not support this feature flag
	// (and therefore it cannot be enabled)
	StateUnsupported State = "unsupported"
)

type TimeUnit added in v2.7.0

type TimeUnit string
const (
	SECONDS TimeUnit = "seconds"
	DAYS    TimeUnit = "days"
	MONTHS  TimeUnit = "months"
	YEARS   TimeUnit = "years"
)

type TopicPermissionInfo

type TopicPermissionInfo struct {
	User  string `json:"user"`
	Vhost string `json:"vhost"`

	// Configuration topic-permissions
	Exchange string `json:"exchange"`
	// Write topic-permissions
	Write string `json:"write"`
	// Read topic-permissions
	Read string `json:"read"`
}

TopicPermissionInfo represents a user's permissions on a topic.

type TopicPermissions

type TopicPermissions struct {
	Exchange string `json:"exchange"`
	Write    string `json:"write"`
	Read     string `json:"read"`
}

TopicPermissions represents a user's permissions on a topic.

type URISet added in v2.9.0

type URISet []string

URISet represents a set of URIs used by Shovel, Federation, and so on. The URIs from this set are tried until one of them succeeds (a shovel or federation link successfully connects and authenticates with it)

func (*URISet) UnmarshalJSON added in v2.9.0

func (s *URISet) UnmarshalJSON(b []byte) error

UnmarshalJSON can unmarshal a single URI string or a list of URI strings

type UserConnectionInfo added in v2.16.0

type UserConnectionInfo struct {
	// Connection name
	Name string `json:"name"`
	// Node the client is connected to
	Node string `json:"node"`
	// Username
	User string `json:"user"`
	// Virtual host
	Vhost string `json:"vhost"`
}

Connection of a specific user. This provides just enough information to the monitoring tools.

type UserInfo

type UserInfo struct {
	Name             string           `json:"name"`
	PasswordHash     string           `json:"password_hash"`
	HashingAlgorithm HashingAlgorithm `json:"hashing_algorithm,omitempty"`
	// Tags control permissions. Built-in tags: administrator, management, policymaker.
	Tags UserTags `json:"tags"`
}

UserInfo represents a user record. Only relevant when internal authentication backend is used.

type UserLimits added in v2.12.0

type UserLimits []string

UserLimits are properties used to delete virtual host limits (max-connections, max-channels)

type UserLimitsInfo added in v2.12.0

type UserLimitsInfo struct {
	User  string           `json:"user"`
	Value UserLimitsValues `json:"value"`
}

UserLimitsInfo holds information about the current user limits

type UserLimitsValues added in v2.12.0

type UserLimitsValues map[string]int

UserLimitsValues are properties used to modify virtual host limits (max-connections, max-channels)

type UserSettings

type UserSettings struct {
	Name string `json:"name"`
	// Tags control permissions. Administrator grants full
	// permissions, management grants management UI and HTTP API
	// access, policymaker grants policy management permissions.
	Tags UserTags `json:"tags"`

	// *never* returned by RabbitMQ. Set by the client
	// to create/update a user. MK.
	Password         string           `json:"password,omitempty"`
	PasswordHash     string           `json:"password_hash,omitempty"`
	HashingAlgorithm HashingAlgorithm `json:"hashing_algorithm,omitempty"`
}

UserSettings represents properties of a user. Used to create users. Tags must be comma-separated.

type UserTags added in v2.7.0

type UserTags []string

UserTags represents tags of a user. In HTTP API responses this can be a JSON array (3.9.0+) or a comma-separated list in a string.

func (UserTags) MarshalJSON added in v2.7.0

func (d UserTags) MarshalJSON() ([]byte, error)

MarshalJSON can marshal an array of strings or a comma-separated list in a string

func (*UserTags) UnmarshalJSON added in v2.7.0

func (d *UserTags) UnmarshalJSON(b []byte) error

UnmarshalJSON can unmarshal an array of strings or a comma-separated list in a string

type VhostInfo

type VhostInfo struct {
	// Virtual host name
	Name string `json:"name"`
	// Virtual host description
	Description string `json:"description"`
	// Virtual host tags
	Tags VhostTags `json:"tags"`
	// Type of queue to create in virtual host when unspecified
	DefaultQueueType string `json:"default_queue_type"`
	// True if tracing is enabled for this virtual host
	Tracing bool `json:"tracing"`

	// Total number of messages in queues of this virtual host
	Messages        int         `json:"messages"`
	MessagesDetails RateDetails `json:"messages_details"`

	// Total number of messages ready to be delivered in queues of this virtual host
	MessagesReady        int         `json:"messages_ready"`
	MessagesReadyDetails RateDetails `json:"messages_ready_details"`

	// Total number of messages pending acknowledgement from consumers in this virtual host
	MessagesUnacknowledged        int         `json:"messages_unacknowledged"`
	MessagesUnacknowledgedDetails RateDetails `json:"messages_unacknowledged_details"`

	// Octets received
	RecvOct uint64 `json:"recv_oct"`
	// Octets sent
	SendOct        uint64      `json:"send_oct"`
	RecvCount      uint64      `json:"recv_cnt"`
	SendCount      uint64      `json:"send_cnt"`
	SendPending    uint64      `json:"send_pend"`
	RecvOctDetails RateDetails `json:"recv_oct_details"`
	SendOctDetails RateDetails `json:"send_oct_details"`

	// Cluster State
	ClusterState map[string]string `json:"cluster_state"`
}

VhostInfo represents a virtual host, its properties and key metrics.

type VhostLimits added in v2.11.0

type VhostLimits []string

VhostLimits are properties used to delete virtual host limits (max-connections, max-queues)

type VhostLimitsInfo added in v2.11.0

type VhostLimitsInfo struct {
	Vhost string            `json:"vhost"`
	Value VhostLimitsValues `json:"value"`
}

VhostLimitsInfo holds information about the current virtual host limits

type VhostLimitsValues added in v2.11.0

type VhostLimitsValues map[string]int

VhostLimitsValues are properties used to modify virtual host limits (max-connections, max-queues)

type VhostSettings

type VhostSettings struct {
	// Virtual host description
	Description string `json:"description"`
	// Virtual host tags
	Tags VhostTags `json:"tags"`
	// Type of queue to create in virtual host when unspecified
	DefaultQueueType string `json:"default_queue_type,omitempty"`
	// True if tracing should be enabled.
	Tracing bool `json:"tracing"`
}

VhostSettings are properties used to create or modify virtual hosts.

type VhostTags added in v2.9.0

type VhostTags []string

func (VhostTags) MarshalJSON added in v2.9.0

func (d VhostTags) MarshalJSON() ([]byte, error)

MarshalJSON can marshal an array of strings or a comma-separated list in a string

func (*VhostTags) UnmarshalJSON added in v2.9.0

func (d *VhostTags) UnmarshalJSON(b []byte) error

UnmarshalJSON can unmarshal an array of strings or a comma-separated list in a string

type WhoamiInfo

type WhoamiInfo struct {
	Name        string   `json:"name"`
	Tags        UserTags `json:"tags"`
	AuthBackend string   `json:"auth_backend"`
}

WhoamiInfo represents a user whose request was successfully authenticated by the "whoami" API endpoint.

Jump to

Keyboard shortcuts

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