healthcheck

package
v0.0.0-...-d34c59c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHCServiceToDomainServiceInfo

func ConvertHCServiceToDomainServiceInfo(hcService *HCService) *domain.ServiceInfo

ConvertHCServiceToDomainServiceInfo ...

func PrepareDataForIPVS

func PrepareDataForIPVS(rawIP,
	rawPort,
	rawRoutingType,
	rawBalanceType,
	rawProtocol string,
	rawApplicationServers []*HCApplicationServer) (string,
	uint16,
	uint32,
	string,
	uint16,
	map[string]uint16,
	error)

PrepareDataForIPVS ...

func PrepareServiceForIPVS

func PrepareServiceForIPVS(rawIP,
	rawPort,
	rawRoutingType,
	rawBalanceType,
	rawProtocol string) (string,
	uint16,
	uint32,
	string,
	uint16,
	error)

PrepareServiceForIPVS ...

func RemoveFromDummy

func RemoveFromDummy(serviceIP string) error

RemoveFromDummy remove service from dummy

Types

type HCApplicationServer

type HCApplicationServer struct {
	sync.RWMutex        `json:"-"`
	Address             string     `json:"address"`
	IP                  string     `json:"ip"`
	Port                string     `json:"port"`
	IsUp                bool       `json:"isUp"`
	HCAddress           string     `json:"hcAddress"`
	InternalHC          InternalHC `json:"hcApplicationServer"`
	ExampleBashCommands string     `json:"-"`
}

func (*HCApplicationServer) String

func (hcApplicationServer *HCApplicationServer) String() string

Release stringer interface for print/log data in []*ApplicationServer

type HCService

type HCService struct {
	sync.RWMutex          `json:"-"`
	Address               string                 `json:"address"`
	IP                    string                 `json:"ip"`
	Port                  string                 `json:"port"`
	IsUp                  bool                   `json:"isUp"`
	BalanceType           string                 `json:"balanceType"`
	RoutingType           string                 `json:"routingType"`
	Protocol              string                 `json:"protocol"`
	AlivedAppServersForUp int                    `json:"alivedAppServersForUp"`
	HCType                string                 `json:"hcType"`
	HCRepeat              time.Duration          `json:"hcRepeat"`
	HCTimeout             time.Duration          `json:"hcTimeout"`
	HCNearFieldsMode      bool                   `json:"hcNearFieldsMode,omitempty"`
	HCUserDefinedData     map[string]string      `json:"hcUserDefinedData,omitempty"`
	HCRetriesForUP        int                    `json:"hcRetriesForUP"`
	HCRetriesForDown      int                    `json:"hcRetriesForDown"`
	HCApplicationServers  []*HCApplicationServer `json:"ApplicationServers"`
	HCStop                chan struct{}          `json:"-"`
	HCStopped             chan struct{}          `json:"-"`
}

TODO: move HC to other service HCService ...

func ConvertDomainServiceToHCService

func ConvertDomainServiceToHCService(domainServiceInfo *domain.ServiceInfo) *HCService

ConvertDomainServiceToHCService ...

type HeathcheckEntity

type HeathcheckEntity struct {
	sync.Mutex
	StopAllHeatlthchecks chan struct{}
	AllHeatlthchecksDone chan struct{}
	// contains filtered or unexported fields
}

HeathcheckEntity ...

func NewHeathcheckEntity

func NewHeathcheckEntity(cacheStorage *portadapter.StorageEntity,
	persistentStorage *portadapter.StorageEntity,
	ipvsadm domain.IPVSWorker,
	rawTechInterface string,
	locker *domain.Locker,
	gracefulShutdown *domain.GracefulShutdown,
	isMockMode bool,
	logging *logrus.Logger) *HeathcheckEntity

NewHeathcheckEntity ...

func (*HeathcheckEntity) CheckApplicationServersInService

func (hc *HeathcheckEntity) CheckApplicationServersInService(hcService *HCService)

CheckApplicationServersInService ...

func (*HeathcheckEntity) NewServiceToHealtchecks

func (hc *HeathcheckEntity) NewServiceToHealtchecks(hcService *HCService)

NewServiceToHealtchecks - add service for healthchecks

func (*HeathcheckEntity) RemoveServiceFromHealtchecks

func (hc *HeathcheckEntity) RemoveServiceFromHealtchecks(hcService *HCService)

RemoveServiceFromHealtchecks will work until removed

func (*HeathcheckEntity) StartGracefulShutdownControlForHealthchecks

func (hc *HeathcheckEntity) StartGracefulShutdownControlForHealthchecks()

StartGracefulShutdownControlForHealthchecks ...

func (*HeathcheckEntity) StartHealthchecksForCurrentServices

func (hc *HeathcheckEntity) StartHealthchecksForCurrentServices() error

StartHealthchecksForCurrentServices ...

func (*HeathcheckEntity) UpdateServiceAtHealtchecks

func (hc *HeathcheckEntity) UpdateServiceAtHealtchecks(hcService *HCService) error

UpdateServiceAtHealtchecks ...

type IPVSADMEntity

type IPVSADMEntity struct {
	sync.Mutex
	// contains filtered or unexported fields
}

IPVSADMEntity ...

func NewIPVSADMEntity

func NewIPVSADMEntity(logging *logrus.Logger) (*IPVSADMEntity, error)

NewIPVSADMEntity ...

func (*IPVSADMEntity) AddApplicationServersForService

func (ipvsadmEntity *IPVSADMEntity) AddApplicationServersForService(vip string,
	port uint16,
	routingType uint32,
	balanceType string,
	protocol uint16,
	applicationServers map[string]uint16,
	updateServiceID string) error

AddApplicationServersForService ...

func (*IPVSADMEntity) Flush

func (ipvsadmEntity *IPVSADMEntity) Flush() error

Flush remove all ipvsadm data

func (*IPVSADMEntity) IsApplicationServerInService

func (ipvsadmEntity *IPVSADMEntity) IsApplicationServerInService(serviceIP string,
	servicePort uint16,
	applicationServerIP string,
	applicationServerPort uint16) (bool, error)

IsApplicationServerInService ...

func (*IPVSADMEntity) NewService

func (ipvsadmEntity *IPVSADMEntity) NewService(vip string,
	port uint16,
	routingType uint32,
	balanceType string,
	protocol uint16,
	applicationServers map[string]uint16,
	createServiceID string) error

NewService ...

func (*IPVSADMEntity) RemoveApplicationServersFromService

func (ipvsadmEntity *IPVSADMEntity) RemoveApplicationServersFromService(vip string,
	port uint16,
	routingType uint32,
	balanceType string,
	protocol uint16,
	applicationServers map[string]uint16,
	updateServiceID string) error

RemoveApplicationServersFromService ...

func (*IPVSADMEntity) RemoveService

func (ipvsadmEntity *IPVSADMEntity) RemoveService(vip string,
	port uint16,
	protocol uint16,
	requestID string) error

RemoveService ...

type InternalHC

type InternalHC struct {
	HCType           string
	HCAddress        string
	HCTimeout        time.Duration
	RetriesForUP     []bool
	RetriesForDown   []bool
	LastIndexForUp   int
	LastIndexForDown int
	NearFieldsMode   bool
	UserDefinedData  map[string]string
}

type UnknownDataStruct

type UnknownDataStruct struct {
	UnknowMap         map[string]string
	UnknowArrayOfMaps []map[string]string
}

UnknownDataStruct used for trying to get an unknown json or array of json's

Jump to

Keyboard shortcuts

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