http

package module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IHttpServer

type IHttpServer interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	GetPort() int
	OnReady(cb func())
}

type Option

type Option struct {
	Host             string   `snow:"Host"`
	MinPort          int      `snow:"MinPort"`
	MaxPort          int      `snow:"MaxPort"`
	KeepAliveSeconds int      `snow:"KeepAliveSeconds"`
	TimeoutSeconds   int      `snow:"TimeoutSeconds"`
	WhiteList        []string `snow:"WhiteList"`
	UncheckedPath    []string `snow:"UncheckedPath"`
	Debug            bool     `snow:"Debug"`
}

type Server

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

func (*Server) Construct

func (ss *Server) Construct(opt *option.Option[*Option], logger *logging.Logger[Server])

func (*Server) GetPort

func (ss *Server) GetPort() int

func (*Server) HandleFunc

func (ss *Server) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*Server) HandleFuncMethod

func (ss *Server) HandleFuncMethod(pattern string, method string, handler func(http.ResponseWriter, *http.Request))

func (*Server) OnReady

func (ss *Server) OnReady(callback func())

func (*Server) Start

func (ss *Server) Start(ctx context.Context, wg *sync.TimeoutWaitGroup)

func (*Server) Stop

func (ss *Server) Stop(ctx context.Context, wg *sync.TimeoutWaitGroup)

Jump to

Keyboard shortcuts

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