part

package
v0.28.20231214150658 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMethod added in v0.28.1

func IsMethod(r *http.Request, method ...string) bool

func NewLimitItem added in v0.27.16

func NewLimitItem(max int) *limitItem

func WithFlush added in v0.28.1

func WithStatusCode added in v0.27.16

func WithStatusCode(w http.ResponseWriter, code int)

Types

type Cache added in v0.27.13

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

func (*Cache) Cache added in v0.27.15

func (t *Cache) Cache(key string, aliveDur time.Duration, w http.ResponseWriter) http.ResponseWriter

func (*Cache) IsCache added in v0.27.13

func (t *Cache) IsCache(key string) (data *[]byte, isCache bool)

type Limits added in v0.27.16

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

func (*Limits) AddCount added in v0.27.16

func (t *Limits) AddCount(r *http.Request) (isOverflow bool)

func (*Limits) AddLimitItem added in v0.27.16

func (t *Limits) AddLimitItem(item *limitItem)

func (*Limits) ReachMax added in v0.27.16

func (t *Limits) ReachMax(r *http.Request) (isOverflow bool)

type Web

type Web struct {
	Server *http.Server
	// contains filtered or unexported fields
}

func Easy_boot

func Easy_boot() *Web

func New

func New(conf *http.Server) (o *Web)

func (*Web) Handle

func (t *Web) Handle(path_func map[string]func(http.ResponseWriter, *http.Request))

func (*Web) Shutdown added in v0.24.2

func (t *Web) Shutdown(ctx ...context.Context)

type WebPath added in v0.22.4

type WebPath struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*WebPath) Load added in v0.22.4

func (t *WebPath) Load(path string) (func(w http.ResponseWriter, r *http.Request), bool)

func (*WebPath) LoadPerfix added in v0.28.20231202144738

func (t *WebPath) LoadPerfix(path string) (func(w http.ResponseWriter, r *http.Request), bool)

func (*WebPath) Store added in v0.22.4

func (t *WebPath) Store(path string, f func(w http.ResponseWriter, r *http.Request))

type WebSync added in v0.22.4

type WebSync struct {
	Server *http.Server
	// contains filtered or unexported fields
}

func NewSyncMap added in v0.22.1

func NewSyncMap(conf *http.Server, m *WebPath, matchFunc ...func(path string) (func(w http.ResponseWriter, r *http.Request), bool)) (o *WebSync)

func (*WebSync) Shutdown added in v0.24.2

func (t *WebSync) Shutdown(ctx ...context.Context)

Jump to

Keyboard shortcuts

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