admin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONResponse

func JSONResponse(w http.ResponseWriter, data interface{}, code int) (int, error)

func NewWebsocket added in v0.0.2

func NewWebsocket()

Types

type Binding

type Binding struct {
	Queue      string `json:"queue"`
	Exchange   string `json:"exchange"`
	RoutingKey string `json:"routing_key"`
}

type BindingsHandler

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

func NewBindingsHandler

func NewBindingsHandler(amqpServer *server.Server) *BindingsHandler

func (*BindingsHandler) Index added in v0.0.2

func (h *BindingsHandler) Index(ctx context.Context, c *frame.Context)

type BindingsResponse

type BindingsResponse struct {
	Items []*Binding `json:"items"`
}

type Channel

type Channel struct {
	ConnID    uint64                        `json:"conn_id"`
	ChannelID uint16                        `json:"channel_id"`
	Channel   string                        `json:"channel"`
	Status    string                        `json:"status"`
	Vhost     string                        `json:"vhost"`
	User      string                        `json:"user"`
	Qos       string                        `json:"qos"`
	Confirm   bool                          `json:"confirm"`
	Consumers int                           `json:"consumers"`
	Counters  map[string]*metrics.TrackItem `json:"counters"`
}

type ChannelRequest added in v0.0.2

type ChannelRequest struct {
	ID  uint16 `json:"id"`
	Tag string `json:"tag"`
}

type ChannelsHandler

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

func NewChannelsHandler

func NewChannelsHandler(amqpServer *server.Server) *ChannelsHandler

func (*ChannelsHandler) Close added in v0.0.2

func (h *ChannelsHandler) Close(ctx context.Context, c *frame.Context)

func (*ChannelsHandler) Consumers added in v0.0.2

func (h *ChannelsHandler) Consumers(ctx context.Context, c *frame.Context)

func (*ChannelsHandler) Delete added in v0.0.2

func (h *ChannelsHandler) Delete(ctx context.Context, c *frame.Context)

func (*ChannelsHandler) DeleteConsumer added in v0.0.2

func (h *ChannelsHandler) DeleteConsumer(ctx context.Context, c *frame.Context)

func (*ChannelsHandler) Index added in v0.0.2

func (h *ChannelsHandler) Index(ctx context.Context, c *frame.Context)

type ChannelsResponse

type ChannelsResponse struct {
	Items []*Channel `json:"items"`
}

type Connection

type Connection struct {
	ID            uint64             `json:"id"`
	Vhost         string             `json:"vhost"`
	Addr          string             `json:"addr"`
	ChannelsCount int                `json:"channels_count"`
	User          string             `json:"user"`
	Protocol      string             `json:"protocol"`
	FromClient    *metrics.TrackItem `json:"from_client"`
	ToClient      *metrics.TrackItem `json:"to_client"`
}

type ConnectionsHandler

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

func NewConnectionsHandler

func NewConnectionsHandler(amqpServer *server.Server) *ConnectionsHandler

func (*ConnectionsHandler) ClearQueues added in v0.0.2

func (h *ConnectionsHandler) ClearQueues(ctx context.Context, c *frame.Context)

func (*ConnectionsHandler) Close added in v0.0.2

func (h *ConnectionsHandler) Close(ctx context.Context, c *frame.Context)

func (*ConnectionsHandler) Index added in v0.0.2

func (h *ConnectionsHandler) Index(ctx context.Context, c *frame.Context)

type ConnectionsResponse

type ConnectionsResponse struct {
	Items []*Connection `json:"items"`
}

type Consumer added in v0.0.2

type Consumer struct {
	ID        uint64 `json:"id"`
	ChannelID uint16 `json:"channel_id"`
	Channel   string `json:"channel"`
	Active    bool   `json:"active"`
	Tag       string `json:"tag"`
	Queue     string `json:"queue"`
}

type ConsumerHandler added in v0.0.2

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

func NewConsumerHandler added in v0.0.2

func NewConsumerHandler(amqpServer *server.Server) *ConsumerHandler

func (*ConsumerHandler) Cancel added in v0.0.2

func (h *ConsumerHandler) Cancel(ctx context.Context, c *frame.Context)

func (*ConsumerHandler) Index added in v0.0.2

func (h *ConsumerHandler) Index(ctx context.Context, c *frame.Context)

func (*ConsumerHandler) Pause added in v0.0.2

func (h *ConsumerHandler) Pause(ctx context.Context, c *frame.Context)

func (*ConsumerHandler) Resume added in v0.0.2

func (h *ConsumerHandler) Resume(ctx context.Context, c *frame.Context)

func (*ConsumerHandler) Stop added in v0.0.2

func (h *ConsumerHandler) Stop(ctx context.Context, c *frame.Context)

type ConsumerResponse added in v0.0.2

type ConsumerResponse struct {
	Items []Consumer `json:"items"`
}

type ExQueueRequest added in v0.0.2

type ExQueueRequest struct {
	Exchange string `json:"exchange"`
	Queue    string `json:"queue"`
}

type Exchange

type Exchange struct {
	Name       string             `json:"name"`
	Vhost      string             `json:"vhost"`
	Type       string             `json:"type"`
	Durable    bool               `json:"durable"`
	Internal   bool               `json:"internal"`
	AutoDelete bool               `json:"auto_delete"`
	MsgRateIn  *metrics.TrackItem `json:"msg_rate_in"`
	MsgRateOut *metrics.TrackItem `json:"msg_rate_out"`
}

type ExchangesHandler

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

func NewExchangesHandler

func NewExchangesHandler(amqpServer *server.Server) *ExchangesHandler

func (*ExchangesHandler) Index added in v0.0.2

func (h *ExchangesHandler) Index(ctx context.Context, c *frame.Context)

func (*ExchangesHandler) RemoveQueue added in v0.0.2

func (h *ExchangesHandler) RemoveQueue(ctx context.Context, c *frame.Context)

type ExchangesResponse

type ExchangesResponse struct {
	Items []*Exchange `json:"items"`
}

type Metric

type Metric struct {
	Name   string               `json:"name"`
	Sample []*metrics.TrackItem `json:"sample"`
	Value  int64                `json:"value"`
}

type OverviewHandler

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

func NewOverviewHandler

func NewOverviewHandler(amqpServer *server.Server) *OverviewHandler

func (*OverviewHandler) Index added in v0.0.2

func (h *OverviewHandler) Index(ctx context.Context, c *frame.Context)

type OverviewResponse

type OverviewResponse struct {
	ServerInfo  ServerInfo           `json:"server_info"`
	Metrics     []*Metric            `json:"metrics"`
	Counters    map[string]int       `json:"counters"`
	Connections *ConnectionsResponse `json:"connections"`
	Channels    *ChannelsResponse    `json:"channels"`
	Exchanges   *ExchangesResponse   `json:"exchanges"`
	Queues      *QueuesResponse      `json:"queues"`
	Consumers   *ConsumerResponse    `json:"consumers"`
}

type Queue

type Queue struct {
	Name       string                        `json:"name"`
	Vhost      string                        `json:"vhost"`
	Durable    bool                          `json:"durable"`
	AutoDelete bool                          `json:"auto_delete"`
	Exclusive  bool                          `json:"exclusive"`
	Active     bool                          `json:"active"`
	Consumers  int                           `json:"consumers"`
	Counters   map[string]*metrics.TrackItem `json:"counters"`
}

type QueuesHandler

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

func NewQueuesHandler

func NewQueuesHandler(amqpServer *server.Server) *QueuesHandler

func (*QueuesHandler) Consumers added in v0.0.2

func (h *QueuesHandler) Consumers(ctx context.Context, c *frame.Context)

func (*QueuesHandler) Index added in v0.0.2

func (h *QueuesHandler) Index(ctx context.Context, c *frame.Context)

func (*QueuesHandler) Pause added in v0.0.2

func (h *QueuesHandler) Pause(ctx context.Context, c *frame.Context)

func (*QueuesHandler) Start added in v0.0.2

func (h *QueuesHandler) Start(ctx context.Context, c *frame.Context)

func (*QueuesHandler) Stop added in v0.0.2

func (h *QueuesHandler) Stop(ctx context.Context, c *frame.Context)

type QueuesResponse

type QueuesResponse struct {
	Items []*Queue `json:"items"`
}

type Server

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

func NewServer

func NewServer(amqpServer *server.Server, host string, port string) *Server

func (*Server) Start

func (server *Server) Start() error

type ServerInfo added in v0.0.2

type ServerInfo struct {
	ID    uint64 `json:"id"`
	Name  string `json:"name"`
	URL   string `json:"url"`
	Stats *Stats `json:"stats"`
}

type Stats added in v0.0.2

type Stats struct {
	PID StatsPID `json:"pid"`
	OS  StatsOS  `json:"os"`
}

func SystemInfo added in v0.0.2

func SystemInfo() *Stats

type StatsOS added in v0.0.2

type StatsOS struct {
	CPU      float64 `json:"cpu"`
	RAM      uint64  `json:"ram"`
	TotalRAM uint64  `json:"total_ram"`
	LoadAvg  float64 `json:"load_avg"`
	Conns    int     `json:"conns"`
}

type StatsPID added in v0.0.2

type StatsPID struct {
	CPU   float64 `json:"cpu"`
	RAM   uint64  `json:"ram"`
	Conns int     `json:"conns"`
}

Jump to

Keyboard shortcuts

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