pinger

package
v0.0.0-...-73dc979 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(configFile *string, signals chan os.Signal)

Run is an entrypoint for pinger

Types

type Postgres

type Postgres struct {
	Connection *pgconn.PgConn
	DSN        string
	IsAlive    bool
	Mutex      *sync.Mutex

	State     string
	WaitGroup *sync.WaitGroup
	// contains filtered or unexported fields
}

Postgres is the main structure for each server

func NewPG

func NewPG(ctx context.Context, server string, wg *sync.WaitGroup) *Postgres

NewPG Create new Postgres instance

func (*Postgres) GetState

func (p *Postgres) GetState()

GetState get Postgres server state (replica or master)

func (*Postgres) NewConn

func (p *Postgres) NewConn()

NewConn create or recreate server connection

func (*Postgres) PgIsAlive

func (p *Postgres) PgIsAlive()

PgIsAlive is checking if PG is alive and count downtimes

Jump to

Keyboard shortcuts

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