httpsrv

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TryFile

func TryFile(req *http.Request, d fs.FS)

TryFile If the file does not exist, return root index.html 需要结合 http.FileServer 使用

func WrapEtagHandler

func WrapEtagHandler(root http.Handler) http.Handler

Types

type Option added in v0.0.4

type Option func(*options)

func WithEnableProxyProtocol added in v0.0.4

func WithEnableProxyProtocol(enable bool) Option

func WithHandler added in v0.0.4

func WithHandler(handler http.Handler) Option

func WithTls added in v0.0.4

func WithTls(tlsConfig *tls.Config) Option

type Service

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

func NewService

func NewService(addr string, ot ...Option) (*Service, error)

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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