server

package
v0.0.0-...-30210cb Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 12 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 {
	Logger *log.Logger
	Port   int
}

Config type

type Option

type Option func(*Config)

Option type

func WithLogger

func WithLogger(logger *log.Logger) Option

WithLogger sets a logger

func WithPort

func WithPort(port int) Option

WithPort sets a port (defaults to 8080)

type Server

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

Server type

func New

func New(options ...Option) (*Server, error)

New creates a new server

func (*Server) Addr

func (svr *Server) Addr() string

Addr returns the address of the server

func (*Server) Start

func (svr *Server) Start() error

Start starts the server

func (*Server) Stop

func (svr *Server) Stop() error

Stop stops the server

Jump to

Keyboard shortcuts

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