server

package
v0.0.0-...-d1dffb0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 10 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 {
	Address string
	Port    string
}

Config provides Server configuration

type HTTPController

type HTTPController interface {
	ServeHTTP(writer http.ResponseWriter, request *http.Request)
}

HTTPController web controller object, for server.New init.

type Server

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

Server type contains http server and controller methods.

func New

func New(routes *map[string]HTTPController, config Config) *Server

New returns an initialized server struct.

func (*Server) GetPort

func (s *Server) GetPort() string

GetPort returns the TCP port the server is using.

func (*Server) Serve

func (s *Server) Serve(c chan int)

Serve start the webserver in a separate go routine.

func (*Server) Wait

func (s *Server) Wait(c chan int) int

Wait waits for server to recieve a Operating System call

Jump to

Keyboard shortcuts

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