discovery

package
v0.0.0-...-31148e1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SlavePattern  = "slave-executor#"
	MasterPattern = "master-executor#"
	TagSlave      = "slave"
	TagMaster     = "master"
)

Variables

This section is empty.

Functions

func GetAvailablePort

func GetAvailablePort() (int, error)

GetAvailablePort - get current free port in system

Types

type Discovery

type Discovery struct {
	CurrentServiceName string
	CurrentServiceType string
	ConsulClient       *consulapi.Client
	ServiceConfig      *config.ServiceConfig
}

func InitializeDiscovery

func InitializeDiscovery(
	typeService string,
	configService *config.ServiceConfig) *Discovery

InitializeDiscovery - инициализация текущего Discovery

func (*Discovery) GetService

func (discovery *Discovery) GetService(serviceName, tag string) []*consulapi.ServiceEntry

GetService - получение текущих сервисов из consul

func (*Discovery) NewClientForConsule

func (discovery *Discovery) NewClientForConsule() error

NewClientForConsule - инициализация подключения до consul

func (*Discovery) RegisterServiceWithConsul

func (discovery *Discovery) RegisterServiceWithConsul(tags []string)

RegisterServiceWithConsul - регистрация сервиса в consul

func (*Discovery) UnregisterCurrentService

func (discovery *Discovery) UnregisterCurrentService()

UnregisterCurrentService - удаление сервиса из consul

Jump to

Keyboard shortcuts

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