server

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package server provides a simple http server.

Index

Constants

View Source
const (
	DefaultHost = "localhost"
	DefaultPort = "50000"
)

Default values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// HTTP gateway host
	Host string
	// HTTP Gateway port
	Port string
}

Config represents http configuration data for the gateway.

type Server

type Server struct {
	*http.ServeMux // embedd (provides Handle and HandleFunc)
	// contains filtered or unexported fields
}

A Server represents a http server.

func New

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

New returns a new server instance.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server address.

func (*Server) Close

func (s *Server) Close() error

Close closes the http server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe starts the server listening to new connections.

Jump to

Keyboard shortcuts

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