kubemq

package
v0.0.0-...-9ba6f28 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseValues

type BaseValues struct {
	Messages int64 `json:"messages"`
	Volume   int64 `json:"volume"`
	Errors   int64 `json:"errors,omitempty"`
	Waiting  int64 `json:"waiting,omitempty"`
}

func NewBaseValues

func NewBaseValues() *BaseValues

func (*BaseValues) SetErrors

func (b *BaseValues) SetErrors(value int64) *BaseValues

func (*BaseValues) SetMessages

func (b *BaseValues) SetMessages(value int64) *BaseValues

func (*BaseValues) SetVolume

func (b *BaseValues) SetVolume(value int64) *BaseValues

func (*BaseValues) SetWaiting

func (b *BaseValues) SetWaiting(value int64) *BaseValues

type Entities

type Entities map[string]map[string]*Entity

func NewEntities

func NewEntities() Entities

func (Entities) AddEntity

func (e Entities) AddEntity(family string, entity *Entity)

func (Entities) GetEntity

func (e Entities) GetEntity(family, name string) (*Entity, bool)

func (Entities) GetFamily

func (e Entities) GetFamily(family string) (map[string]*Entity, bool)

type EntitiesGroup

type EntitiesGroup map[string]*Group

func NewEntitiesGroup

func NewEntitiesGroup() EntitiesGroup

func (EntitiesGroup) GroupEntities

func (eg EntitiesGroup) GroupEntities(family string, entities map[string]*Entity) EntitiesGroup

type Entity

type Entity struct {
	Name string      `json:"name"`
	In   *BaseValues `json:"in"`
	Out  *BaseValues `json:"out"`
}

func NewEntity

func NewEntity(name string) *Entity

func (*Entity) SetIn

func (e *Entity) SetIn(value *BaseValues) *Entity

func (*Entity) SetOut

func (e *Entity) SetOut(value *BaseValues) *Entity

func (*Entity) SetValues

func (e *Entity) SetValues(side, kind string, value int64) *Entity

type Group

type Group struct {
	Total  int         `json:"total"`
	Active int         `json:"active"`
	In     *BaseValues `json:"in"`
	Out    *BaseValues `json:"out"`
}

func NewGroup

func NewGroup() *Group

func (*Group) SetActive

func (g *Group) SetActive(value int) *Group

func (*Group) SetIn

func (g *Group) SetIn(value *BaseValues) *Group

func (*Group) SetOut

func (g *Group) SetOut(value *BaseValues) *Group

func (*Group) SetTotal

func (g *Group) SetTotal(value int) *Group

func (*Group) SetValues

func (g *Group) SetValues(side string, value *BaseValues)

type Info

type Info struct {
	Host           string `json:"host"`
	Version        string `json:"version"`
	Mode           string `json:"mode"`
	IsHealthy      bool   `json:"is_healthy"`
	IsReady        bool   `json:"is_ready"`
	LeadershipRole string `json:"leadership_role"`
}

func NewInfo

func NewInfo() *Info

func (*Info) SetHost

func (i *Info) SetHost(value string) *Info

func (*Info) SetIsHealthy

func (i *Info) SetIsHealthy(value bool) *Info

func (*Info) SetIsReady

func (i *Info) SetIsReady(value bool) *Info

func (*Info) SetLeadershipRole

func (i *Info) SetLeadershipRole(value string) *Info

func (*Info) SetMode

func (i *Info) SetMode(value string) *Info

func (*Info) SetVersion

func (i *Info) SetVersion(value string) *Info

type Response

type Response struct {
	Error       bool            `json:"error"`
	ErrorString string          `json:"error_string"`
	Data        json.RawMessage `json:"data"`
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(c echo.Context) *Response

func (*Response) Send

func (res *Response) Send() error

func (*Response) SendData

func (res *Response) SendData(data []byte) error

func (*Response) SetError

func (res *Response) SetError(err error) *Response

func (*Response) SetErrorWithText

func (res *Response) SetErrorWithText(errText string) *Response

func (*Response) SetHttpCode

func (res *Response) SetHttpCode(value int) *Response

func (*Response) SetResponseBody

func (res *Response) SetResponseBody(data interface{}) *Response

func (*Response) Unmarshal

func (res *Response) Unmarshal(v interface{}) error

type Snapshot

type Snapshot struct {
	Pk       int      `json:"-" storm:"id,increment"`
	Time     int64    `json:"time"`
	Status   *Status  `json:"status"`
	Entities Entities `json:"entities"`
}

func NewSnapshot

func NewSnapshot() *Snapshot

func (*Snapshot) SetEntities

func (s *Snapshot) SetEntities(value Entities) *Snapshot

func (*Snapshot) SetStatus

func (s *Snapshot) SetStatus(value *Status) *Snapshot

type Status

type Status struct {
	Host     string        `json:"host"`
	System   *System       `json:"system"`
	Entities EntitiesGroup `json:"entities"`
}

func NewStatus

func NewStatus(host string) *Status

func (*Status) SetEntities

func (s *Status) SetEntities(value EntitiesGroup) *Status

func (*Status) SetSystem

func (s *Status) SetSystem(value *System) *Status

type System

type System struct {
	ProcessMemory           float64 `json:"process_memory"`
	ProcessMemoryAllocation float64 `json:"process_memory_allocation"`
	GoRoutines              int64   `json:"go_routines"`
	OSThreads               int64   `json:"os_threads"`
	TotalCPUSeconds         float64 `json:"total_cpu_seconds"`
	TotalCPUs               int     `json:"total_cpus"`
	StartTime               float64 `json:"start_time"`
	Uptime                  float64 `json:"uptime"`
	CPUUtilization          float64 `json:"cpu_utilization"`
	MemoryUtilization       float64 `json:"memory_utilization"`
}

func NewSystem

func NewSystem() *System

func (*System) Calc

func (s *System) Calc() *System

func (*System) SetCPUUtilization

func (s *System) SetCPUUtilization(lastUptime, lastCpuSeconds float64) *System

func (*System) SetGoRoutines

func (s *System) SetGoRoutines(value int64) *System

func (*System) SetOSThreads

func (s *System) SetOSThreads(value int64) *System

func (*System) SetProcessMemory

func (s *System) SetProcessMemory(value float64) *System

func (*System) SetProcessMemoryAllocation

func (s *System) SetProcessMemoryAllocation(value float64) *System

func (*System) SetStartTime

func (s *System) SetStartTime(value float64) *System

func (*System) SetTotalCPUSeconds

func (s *System) SetTotalCPUSeconds(value float64) *System

Jump to

Keyboard shortcuts

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