core

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMonitor

func InitMonitor()

func Monitor

func Monitor()

Types

type Coordinator

type Coordinator struct {
	PrimaryNodeID int    `db:"primary_node_id" json:"primary_node_id"`
	Name          string `db:"primary_name" json:"name"`
	Host          string `db:"primary_host" json:"host"`
	Port          int    `db:"primary_port" json:"port"`
}

func GetCoordinator

func GetCoordinator() (*Coordinator, error)

type Node

type Node struct {
	FormationID         string    `db:"formationid" json:"formation_id"`
	ID                  int       `db:"nodeid" json:"id"`
	GroupID             int       `db:"groupid" json:"group_id"`
	Name                string    `db:"nodename" json:"name"`
	Host                string    `db:"nodehost" json:"host"`
	Port                int       `db:"nodeport" json:"port"`
	SysIdentifier       string    `db:"sysidentifier" json:"sys_identifier"`
	GoalState           string    `db:"goalstate" json:"goal_state"`
	ReportedState       string    `db:"reportedstate" json:"reported_state"`
	ReportedPGIsRunning bool      `db:"reportedpgisrunning" json:"reported_pg_is_running"`
	ReportedRepState    string    `db:"reportedrepstate" json:"reported_rep_state"`
	ReportTime          time.Time `db:"reporttime" json:"report_time"`
	ReportedLSN         string    `db:"reportedlsn" json:"reported_lsn"`
	WALReportTime       time.Time `db:"walreporttime" json:"wal_report_time"`
	Health              int       `db:"health" json:"health"`
	HealthCheckTime     time.Time `db:"healthchecktime" json:"health_check_time"`
	StateChangeTime     time.Time `db:"statechangetime" json:"state_change_time"`
	CandidatePriority   int       `db:"candidatepriority" json:"candidate_priority"`
	ReplicationQuorum   bool      `db:"replicationquorum" json:"replication_quorum"`
	NodeCluster         string    `db:"nodecluster" json:"node_cluster"`
	IsCoordinator       bool      `db:"-" json:"-"`
}

func GetAllCoordinators

func GetAllCoordinators() ([]*Node, error)

func GetNodes

func GetNodes() ([]*Node, error)

type NullBool

type NullBool struct {
	sql.NullBool
}

NullBool is an alias for sql.NullBool data type

func (NullBool) MarshalJSON

func (nb NullBool) MarshalJSON() ([]byte, error)

MarshalJSON for NullBool

func (*NullBool) UnmarshalJSON

func (nb *NullBool) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullBool

type NullFloat64

type NullFloat64 struct {
	sql.NullFloat64
}

NullFloat64 is an alias for sql.NullFloat64 data type

func Float64ToNullFloat64

func Float64ToNullFloat64(f float64) NullFloat64

func (NullFloat64) MarshalJSON

func (nf NullFloat64) MarshalJSON() ([]byte, error)

MarshalJSON for NullFloat64

func (*NullFloat64) UnmarshalJSON

func (nf *NullFloat64) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullFloat64

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

NullInt64 is an alias for sql.NullInt64 data type

func Int64ToNullInt64

func Int64ToNullInt64(i int64) NullInt64

func (NullInt64) MarshalJSON

func (ni NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON for NullInt64

func (*NullInt64) ToInt64

func (ni *NullInt64) ToInt64() int64

func (*NullInt64) UnmarshalJSON

func (ni *NullInt64) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullInt64

type NullString

type NullString struct {
	sql.NullString
}

NullString is an alias for sql.NullString data type

func StringToNullString

func StringToNullString(s string) NullString

func (NullString) MarshalJSON

func (ns NullString) MarshalJSON() ([]byte, error)

MarshalJSON for NullString

func (*NullString) ToString

func (ns *NullString) ToString() string

func (*NullString) UnmarshalJSON

func (ns *NullString) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullString

type NullTime

type NullTime struct {
	pq.NullTime
}

func TimeToNullTime

func TimeToNullTime(t time.Time, null bool) NullTime

func (NullTime) MarshalJSON

func (nt NullTime) MarshalJSON() ([]byte, error)

func (*NullTime) UnmarshalJSON

func (nt *NullTime) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullTime

type Worker

type Worker struct {
	ID               int      `db:"nodeid" json:"id"`
	GroupID          int      `db:"groupid" json:"group_id"`
	Host             string   `db:"nodename" json:"host"`
	Port             int      `db:"nodeport" json:"port"`
	Rack             string   `db:"noderack" json:"rack"`
	HasMetaData      NullBool `db:"hasmetadata" json:"has_meta_data"`
	Active           bool     `db:"isactive" json:"active"`
	Role             string   `db:"noderole" json:"role"`
	Cluster          string   `db:"nodecluster" json:"cluster"`
	MetaDataSynced   NullBool `db:"metadatasynced" json:"meta_data_synced"`
	ShouldHaveShards bool     `db:"shouldhaveshards" json:"should_have_shards"`
}

func GetPrimaryWorkers

func GetPrimaryWorkers() ([]*Worker, error)

Jump to

Keyboard shortcuts

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