monitor

package
v0.0.0-...-4d42d77 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionActive          PatchAction = "active"
	ActionDetach          PatchAction = "detach"
	ActionPause           PatchAction = "pause"
	ActionRegisterMaster  PatchAction = "master"
	ActionRegisterStandby PatchAction = "standby"
	ActionRegisterSlave   PatchAction = "slave"
	ActionResume          PatchAction = "resume"
	ActionSwtich          PatchAction = "switch"
	ActionUnregister      PatchAction = "unregister"

	GetAllOverview GetType = "overview"
	GetOneDetails  GetType = "detail"
)
View Source
const (
	MonitorPort     = "6033"
	MonitorLocation = "/servers"
)
View Source
const (
	CooldownTime = 3 * time.Second
)

Variables

View Source
var (
	ConsoleAuthURL = fmt.Sprintf("http://console.%s/api/v1/repos/%s/roles/", lainDomain, lainAppName)

	SecretConf = getSecretConf()
)

Functions

func Get

func Get(req GetRequest)

Get receives a GetRequest and sends to monitor to handle

func GetLainConf

func GetLainConf(key string) ([]byte, error)

func Patch

func Patch(req PatchRequest)

Patch receives a PatchRequest and sends to monitor to handle

func Start

func Start()

Start starts the main goroutine of monitor

Types

type AppProcs

type AppProcs struct {
	Procs []ProcInstance `json:"proc"`
}

type AuthConfInfo

type AuthConfInfo struct {
	Type string `json:"type"`
}

type GetRequest

type GetRequest struct {
	RequestType  GetType
	Params       map[string]string
	ResponseChan chan GetResponse
}

type GetResponse

type GetResponse struct {
	Data []byte
	Err  error
	Code int
}

type GetType

type GetType string

type InstanceModel

type InstanceModel struct {
	Role              string
	Addr              string
	Port              string
	InstanceStatus    msops.InstanceStatus
	ReplicationStatus msops.ReplicationStatus
}

type InstanceView

type InstanceView struct {
	Addr                  string
	Port                  string
	Role                  string
	InstanceStatusText    string
	ReplicationStatusText string
	AllowedActions        []string
	ProcessesList         []map[string]string
	SlaveStatusList       map[string]string
	PerformanceStatusList map[string]string
}

type InstanceViewSorter

type InstanceViewSorter []InstanceView

func (InstanceViewSorter) Len

func (svs InstanceViewSorter) Len() int

func (InstanceViewSorter) Less

func (svs InstanceViewSorter) Less(i, j int) bool

func (InstanceViewSorter) Swap

func (svs InstanceViewSorter) Swap(i, j int)

type MySQLMonitor

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

func (MySQLMonitor) ServeHTTP

func (monitor MySQLMonitor) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP sends a singal to monitor sending init event to the new proxy

type PatchAction

type PatchAction string

type PatchRequest

type PatchRequest struct {
	Action       PatchAction
	Endpoint     string
	ResponseChan chan PatchResponse
}

type PatchResponse

type PatchResponse struct {
	Err  error
	Code int
}

type ProcInstance

type ProcInstance struct {
	InstanceNo int    `json:"InstanceNo"`
	Port       int    `json:"Port"`
	ProcName   string `json:"ProcName"`
}

Jump to

Keyboard shortcuts

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