server

package
v0.0.0-...-5107381 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package server just encapsulates the HTTP server that serves the API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server handles serving the core API for Aetherometer

func New

func New(
	cfg config.Config,
	logger *zap.Logger,
) *Server

New initializes a new instance of the core server

func (*Server) AddHandler

func (s *Server) AddHandler(path string, handler http.Handler)

AddHandler adds a handler to this server

func (*Server) Address

func (s *Server) Address() *net.TCPAddr

Address returns the address of this server. This value is only valid if the server has been started, otherwise it'll be a nil Addr interface value.

func (*Server) Serve

func (s *Server) Serve()

Serve is responsible for running the core server

func (*Server) Stop

func (s *Server) Stop()

Stop will shutdown the core server, and will timeout within 1 second

func (*Server) WaitUntilReady

func (s *Server) WaitUntilReady()

WaitUntilReady blocks until the server has started listening

Directories

Path Synopsis
Package handlers defines handlers for all of the endpoints accessible from the core server.
Package handlers defines handlers for all of the endpoints accessible from the core server.

Jump to

Keyboard shortcuts

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