kafka

package
v0.0.0-...-84c28f3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorClosedNetwork is an error indicating the connection is closed
	ErrorClosedNetwork = "use of closed network connection"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kafka

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

Kafka service

func NewKafka

func NewKafka(verbose bool, logger *log.Logger) *Kafka

NewKafka Kafka's constructor

func (*Kafka) Close

func (d *Kafka) Close() error

Close will close the service resources if needed

func (*Kafka) Connect

func (d *Kafka) Connect() error

Connect to service if needed

func (*Kafka) Enable

func (d *Kafka) Enable(enabled bool)

Enable will set enabled status to service

func (*Kafka) GetCheckInterval

func (d *Kafka) GetCheckInterval() int

GetCheckInterval will return check interval to service

func (*Kafka) GetDownTimeDiff

func (d *Kafka) GetDownTimeDiff() string

GetDownTimeDiff will return down time service difference in minutes

func (*Kafka) GetMessage

func (d *Kafka) GetMessage() string

GetMessage will return additional message

func (*Kafka) IsEnabled

func (d *Kafka) IsEnabled() bool

IsEnabled will return enable status

func (*Kafka) IsRecover

func (d *Kafka) IsRecover() bool

IsRecover will return recovered status

func (*Kafka) Name

func (d *Kafka) Name() string

Name the name of the service

func (*Kafka) Ping

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

Ping will try to ping the service

func (*Kafka) SetCheckInterval

func (d *Kafka) SetCheckInterval(interval int)

SetCheckInterval will set check interval to service

func (*Kafka) SetConfig

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

SetConfig will set config

func (*Kafka) SetLastDownTimeNow

func (d *Kafka) SetLastDownTimeNow()

LastDownTime will set last down time of service to current time

func (*Kafka) SetMessage

func (d *Kafka) SetMessage(message string)

SetMessage will set additional message

func (*Kafka) SetRecover

func (d *Kafka) SetRecover(recovered bool)

SetRecover will set recovered status

func (*Kafka) SetURL

func (d *Kafka) SetURL(url string)

SetURL will set the service URL

func (*Kafka) Stop

func (d *Kafka) 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