Documentation ¶
Index ¶
- func ConvertHCServiceToDomainServiceInfo(hcService *HCService) *domain.ServiceInfo
- func PrepareDataForIPVS(rawIP, rawPort, rawRoutingType, rawBalanceType, rawProtocol string, ...) (string, uint16, uint32, string, uint16, map[string]uint16, error)
- func PrepareServiceForIPVS(rawIP, rawPort, rawRoutingType, rawBalanceType, rawProtocol string) (string, uint16, uint32, string, uint16, error)
- func RemoveFromDummy(serviceIP string) error
- type HCApplicationServer
- type HCService
- type HeathcheckEntity
- func (hc *HeathcheckEntity) CheckApplicationServersInService(hcService *HCService)
- func (hc *HeathcheckEntity) NewServiceToHealtchecks(hcService *HCService)
- func (hc *HeathcheckEntity) RemoveServiceFromHealtchecks(hcService *HCService)
- func (hc *HeathcheckEntity) StartGracefulShutdownControlForHealthchecks()
- func (hc *HeathcheckEntity) StartHealthchecksForCurrentServices() error
- func (hc *HeathcheckEntity) UpdateServiceAtHealtchecks(hcService *HCService) error
- type IPVSADMEntity
- func (ipvsadmEntity *IPVSADMEntity) AddApplicationServersForService(vip string, port uint16, routingType uint32, balanceType string, ...) error
- func (ipvsadmEntity *IPVSADMEntity) Flush() error
- func (ipvsadmEntity *IPVSADMEntity) IsApplicationServerInService(serviceIP string, servicePort uint16, applicationServerIP string, ...) (bool, error)
- func (ipvsadmEntity *IPVSADMEntity) NewService(vip string, port uint16, routingType uint32, balanceType string, ...) error
- func (ipvsadmEntity *IPVSADMEntity) RemoveApplicationServersFromService(vip string, port uint16, routingType uint32, balanceType string, ...) error
- func (ipvsadmEntity *IPVSADMEntity) RemoveService(vip string, port uint16, protocol uint16, requestID string) error
- type InternalHC
- type UnknownDataStruct
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 ¶
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 ¶
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 ...