http

package
v0.10.69 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	Name string
	Port int `validate:"gt=1000,lt=65536"`
}

func (Config) NewServer added in v0.10.58

func (c Config) NewServer(opts ...ServerOption) (Server, error)

type Server

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

func (Server) ListenAndServe

func (s Server) ListenAndServe(context.Context) error

func (Server) Shutdown added in v0.10.21

func (s Server) Shutdown(ctx context.Context) error

func (Server) Validate

func (obj Server) Validate() error

func (Server) WaitForShutdown deprecated

func (s Server) WaitForShutdown(ctx context.Context) error

Deprecated: use closer.AddContextErrorCloser(server.Shutdown) instead

type ServerOption

type ServerOption c.Option[Server]

func WithServerHandler

func WithServerHandler(h http.Handler) ServerOption

func WithServerLogger

func WithServerLogger(logger *zap.Logger) ServerOption

func WithServerName

func WithServerName(name string) ServerOption

func WithServerPort

func WithServerPort(port int) ServerOption

func WithServerShutdownTimeout

func WithServerShutdownTimeout(t time.Duration) ServerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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