Documentation ¶
Index ¶
Constants ¶
View Source
const PriorityMax = 5
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lifecycle ¶
Lifecycle implements the lifecycle operations for microservice including dynamic service registration.
func (*Lifecycle) GetListenerAddress ¶
GetListenerAddress will get the address and port the service is listening. Returns the empty string if the service is not running but the method is invoked.
type LifecycleHandler ¶
type LifecycleHandler interface { Start(port int, background bool) Stop() GetListenerAddress() string }
LifecycleHandler provides basic lifecycle methods that each microservice has to implement.
type Service ¶
func GetService ¶
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *ServiceManager
func (*ServiceManager) Add ¶
func (s *ServiceManager) Add(priority int, factory Factory)
func (*ServiceManager) GetService ¶
func (p *ServiceManager) GetService(name string) Service
GetService return service instance by name, or matched by part of name
func (*ServiceManager) Run ¶
func (s *ServiceManager) Run(server string, opts map[string]interface{}) error
func (*ServiceManager) Shutdown ¶
func (s *ServiceManager) Shutdown(code int, reason string)
Shutdown
Click to show internal directories.
Click to hide internal directories.