server

package
v0.0.0-...-d3a3332 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

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 wraps an http.Server

func NewServer

func NewServer(name string, opts ...ServerOptFunc) (*Server, error)

NewServer configures and returns a new Server instance. Defaults are used when no ServerOptFuncs are provided.

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) ListenAndServe

func (s *Server) ListenAndServe()

type ServerOptFunc

type ServerOptFunc func(*Server) error

ServerOptFunc is a function that can be used to customize a serverer

func WithAddr

func WithAddr(addr string) ServerOptFunc

WithAddr sets the TCP address to listen on for an http server. If one is not provided, http.Server will default to :80.

func WithHandler

func WithHandler(h http.Handler) ServerOptFunc

WithHandler sets the http handler for the server.

Jump to

Keyboard shortcuts

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