server

package
v0.0.0-...-ddad2a0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 9 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 {
	ListenAddr  string `kong:"help='Address and port for the server to listen on.',env='METRIS_LISTENADDR',required=true"`
	TLSCertFile string `kong:"help='Path to TLS certificate file.',type='path',env='METRIS_TLSCERTFILE'"`
	TLSKeyFile  string `kong:"help='Path to TLS key file.',type='path',env='METRIS_TLSKEYFILE'"`
}

type Server

type Server struct {
	Server  *http.Server
	Healthy int32
	// contains filtered or unexported fields
}

Server represents an HTTP server

func NewServer

func NewServer(c Config, logger *zap.SugaredLogger) (*Server, error)

func (*Server) HealthHandler

func (s *Server) HealthHandler() http.Handler

func (*Server) Start

func (s *Server) Start(parentctx context.Context, parentwg *sync.WaitGroup)

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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