pulsaradmin

package module
v0.0.0-...-58bca84 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

README

gopulsaradmin Go Report Card

Golang client for Pulsar Admin.

Usage

Contributors

Code released under Apache License 2.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(dest interface{}, src interface{}) error

func WithDebug

func WithDebug() optionFn

WithDebug enables debug output while interacting with MIPS

func WithKey

func WithKey(key string) optionFn

WithKey contains the MIPS API key

func WithURL

func WithURL(u url.URL) optionFn

WithURL contains the MIPS target url

Types

type BrokerStatsTopicResult

type BrokerStatsTopicResult map[string]Namespace

type Client

type Client struct {
	Key string

	*http.Client
	// contains filtered or unexported fields
}

func New

func New(options ...optionFn) (*Client, error)

New returns a MIPS API client

func (*Client) BrokerStatsTopics

func (c *Client) BrokerStatsTopics() (BrokerStatsTopicResult, error)

func (*Client) Do

func (wd *Client) Do(req *http.Request, v interface{}) error

Do will execute the http.Request and decode the result

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest prepares http.Request to call the MISP API

type Error

type Error struct {
	ErrorCode   int    `json:"error_code"`
	ErrorString string `json:"error"`
}

func (*Error) Error

func (de *Error) Error() string

type ErrorResult

type ErrorResult struct {
	Error string `json:"error"`
}

ErrorResult is the result when an error occurs

type Namespace

type Namespace map[string]NamespaceBundle

type NamespaceBundle

type NamespaceBundle map[string]TopicType

type TopicStats

type TopicStats struct {
	AverageMsgSize         float64 `json:"averageMsgSize"`
	MsgRateIn              float64 `json:"msgRateIn"`
	MsgRateOut             float64 `json:"msgRateOut"`
	MsgThroughputIn        float64 `json:"msgThroughputIn"`
	MsgThroughputOut       float64 `json:"msgThroughputOut"`
	PendingAddEntriesCount int64   `json:"pendingAddEntriesCount"`
	ProducerCount          int64   `json:"producerCount"`
	Publishers             []struct {
		Address        string  `json:"address"`
		AverageMsgSize float64 `json:"averageMsgSize"`
		ClientVersion  string  `json:"clientVersion"`
		ConnectedSince string  `json:"connectedSince"`
		Metadata       struct {
		} `json:"metadata"`
		MsgRateIn       float64 `json:"msgRateIn"`
		MsgThroughputIn float64 `json:"msgThroughputIn"`
		ProducerId      int64   `json:"producerId"`
		ProducerName    string  `json:"producerName"`
	} `json:"publishers"`
	Replication struct {
	} `json:"replication"`
	StorageSize   int64 `json:"storageSize"`
	Subscriptions struct {
		Subscription struct {
			BlockedSubscriptionOnUnackedMsgs bool `json:"blockedSubscriptionOnUnackedMsgs"`
			Consumers                        []struct {
				Address                      string `json:"address"`
				AvailablePermits             int64  `json:"availablePermits"`
				BlockedConsumerOnUnackedMsgs bool   `json:"blockedConsumerOnUnackedMsgs"`
				ClientVersion                string `json:"clientVersion"`
				ConnectedSince               string `json:"connectedSince"`
				ConsumerName                 string `json:"consumerName"`
				Metadata                     struct {
				} `json:"metadata"`
				MsgRateOut       float64 `json:"msgRateOut"`
				MsgRateRedeliver float64 `json:"msgRateRedeliver"`
				MsgThroughputOut float64 `json:"msgThroughputOut"`
				UnackedMessages  int64   `json:"unackedMessages"`
			} `json:"consumers"`
			MsgBacklog                               int64   `json:"msgBacklog"`
			MsgRateExpired                           float64 `json:"msgRateExpired"`
			MsgRateOut                               float64 `json:"msgRateOut"`
			MsgRateRedeliver                         float64 `json:"msgRateRedeliver"`
			MsgThroughputOut                         float64 `json:"msgThroughputOut"`
			NumberOfEntriesSinceFirstNotAckedMessage int64   `json:"numberOfEntriesSinceFirstNotAckedMessage"`
			TotalNonContiguousDeletedMessagesRange   int64   `json:"totalNonContiguousDeletedMessagesRange"`
			Type                                     string  `json:"type"`
			UnackedMessages                          int64   `json:"unackedMessages"`
		} `json:"subscription"`
	} `json:"subscriptions"`
}

type TopicType

type TopicType map[string]TopicStats

Jump to

Keyboard shortcuts

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