server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorization

func Authorization(uc interfaces.UseCase) func(next http.Handler) http.Handler

Authorization is a middleware to check the token in Authorization header. It returns empty string if the token is not found or invalid.

func Logging

func Logging(next http.Handler) http.Handler

Logging is a middleware to log HTTP access

func MemoryLimit added in v0.1.1

func MemoryLimit(limit uint64, read ReadMemStatsFn) func(next http.Handler) http.Handler

Types

type Option added in v0.1.1

type Option func(*serverCfg)

func WithMemoryLimit added in v0.1.1

func WithMemoryLimit(limit uint64) Option

func WithReadMemStats added in v0.1.1

func WithReadMemStats(fn ReadMemStatsFn) Option

type ReadMemStatsFn added in v0.1.1

type ReadMemStatsFn func(m *runtime.MemStats)

type Server

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

func New

func New(uc interfaces.UseCase, options ...Option) *Server

func (*Server) ServeHTTP

func (x *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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