postgres

package
v0.0.0-...-2dec208 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

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

Postgres service

func NewPostgres

func NewPostgres(verbose bool, logger *log.Logger) *Postgres

NewPostgres Postgres's constructor

func (*Postgres) Close

func (d *Postgres) Close() error

Close will close the service resources if needed

func (*Postgres) Connect

func (d *Postgres) Connect() error

Connect to service if needed

func (*Postgres) Enable

func (d *Postgres) Enable(enabled bool)

Enable will set enabled status to service

func (*Postgres) GetCheckInterval

func (d *Postgres) GetCheckInterval() int

GetCheckInterval will return check interval to service

func (*Postgres) GetDownTimeDiff

func (d *Postgres) GetDownTimeDiff() string

GetDownTimeDiff will return down time service difference in minutes

func (*Postgres) GetMessage

func (d *Postgres) GetMessage() string

GetMessage will return additional message

func (*Postgres) GetNotificators

func (d *Postgres) GetNotificators() []tob.Notificator

GetNotificators will return notificators

func (*Postgres) IsEnabled

func (d *Postgres) IsEnabled() bool

IsEnabled will return enable status

func (*Postgres) IsRecover

func (d *Postgres) IsRecover() bool

IsRecover will return recovered status

func (*Postgres) Name

func (d *Postgres) Name() string

Name the name of the service

func (*Postgres) Ping

func (d *Postgres) Ping() []byte

Ping will try to ping the service

func (*Postgres) SetCheckInterval

func (d *Postgres) SetCheckInterval(interval int)

SetCheckInterval will set check interval to service

func (*Postgres) SetConfig

func (d *Postgres) SetConfig(configs config.Config)

SetConfig will set config

func (*Postgres) SetLastDownTimeNow

func (d *Postgres) SetLastDownTimeNow()

LastDownTime will set last down time of service to current time

func (*Postgres) SetMessage

func (d *Postgres) SetMessage(message string)

SetMessage will set additional message

func (*Postgres) SetNotificatorConfig

func (d *Postgres) SetNotificatorConfig(configs config.Config)

SetNotificatorConfig will set config

func (*Postgres) SetRecover

func (d *Postgres) SetRecover(recovered bool)

SetRecover will set recovered status

func (*Postgres) SetURL

func (d *Postgres) SetURL(url string)

SetURL will set the service URL

func (*Postgres) Stop

func (d *Postgres) Stop() chan bool

Stop will receive stop channel

Jump to

Keyboard shortcuts

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