server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor added in v0.12.0

type Monitor struct {
	TTL time.Duration
	// contains filtered or unexported fields
}

func NewMonitor added in v0.12.0

func NewMonitor(ttl time.Duration) *Monitor

func (*Monitor) Monitor added in v0.12.0

func (m *Monitor) Monitor(hrt heart.Heart, sdc <-chan struct{}) (bool, error)

Monitor periodically checks the given Heart to make sure it beats successfully. If the heartbeat check fails for any reason, an error is returned. If the supplied channel is closed, Monitor returns true and a nil error.

type Server

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

func New

func New(cfg config.Config, listeners []net.Listener) (*Server, error)

func (*Server) GetApiServerListeners added in v0.12.0

func (s *Server) GetApiServerListeners() []net.Listener

func (*Server) Kill added in v0.12.0

func (s *Server) Kill()

Kill is used to gracefully terminate the server by triggering the Monitor to shut down

func (*Server) MarshalJSON added in v0.2.0

func (s *Server) MarshalJSON() ([]byte, error)

func (*Server) Purge

func (s *Server) Purge()

func (*Server) Run

func (s *Server) Run()

func (*Server) SetReconfigServer added in v0.12.0

func (s *Server) SetReconfigServer(isReconfigServer bool)

func (*Server) SetRestartServer added in v0.13.0

func (s *Server) SetRestartServer(isRestartServer bool)

func (*Server) Supervise added in v0.12.0

func (s *Server) Supervise()

Supervise monitors the life of the Server and coordinates its shutdown. A shutdown occurs when the monitor returns, either because a health check fails or a user triggers a shutdown. If the shutdown is due to a health check failure, the Server is restarted. Supervise will block shutdown until all components have finished shutting down or a timeout occurs; if this happens, the Server will not automatically be restarted.

Jump to

Keyboard shortcuts

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