server

package
v0.0.0-...-34a2968 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigFile  string
	HomePath    string
	PidFile     string
	Version     string
	Commit      string
	BuildBranch string
	Listener    net.Listener
}

Config contains parameters for the New function.

type Server

type Server struct {
	HTTPServer *api.HTTPServer `inject:""`
	// contains filtered or unexported fields
}

Server is responsible for managing the lifecycle of services.

func New

func New(cfg Config) (*Server, error)

New returns a new instance of Server.

func (*Server) ExitCode

func (s *Server) ExitCode(reason error) int

ExitCode returns an exit code for a given error.

func (*Server) Run

func (s *Server) Run() (err error)

Run initializes and starts services. This will block until all services have exited. To initiate shutdown, call the Shutdown method in another goroutine.

func (*Server) Shutdown

func (s *Server) Shutdown(reason string)

Jump to

Keyboard shortcuts

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