server

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledRoute

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

type FastHTTPServer

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

func NewHTTPServer

func NewHTTPServer(
	ctx context.Context,
	config types.ConfigManager,
	logger types.Logger,
	metrics types.MetricsManager,
	middlewares types.MiddlewareManager,
	tlsManager types.TLSManager,
	router types.HTTPRouter) (*FastHTTPServer, error)

func (*FastHTTPServer) IsRunning

func (h *FastHTTPServer) IsRunning() bool

func (*FastHTTPServer) Start

func (h *FastHTTPServer) Start() error

func (*FastHTTPServer) Stop

func (h *FastHTTPServer) Stop() error

type GroupBuilder

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

func (*GroupBuilder) DELETE

func (gb *GroupBuilder) DELETE(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) GET

func (gb *GroupBuilder) GET(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) Group

func (gb *GroupBuilder) Group(prefix string) types.GroupBuilder

func (*GroupBuilder) PATCH added in v1.1.1

func (gb *GroupBuilder) PATCH(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) POST

func (gb *GroupBuilder) POST(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) PUT

func (gb *GroupBuilder) PUT(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) Route

func (gb *GroupBuilder) Route(method, path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*GroupBuilder) WithCache

func (gb *GroupBuilder) WithCache(key string, ttl time.Duration, dependencies ...string) types.GroupBuilder

func (*GroupBuilder) WithMiddlewares

func (gb *GroupBuilder) WithMiddlewares(names ...string) types.GroupBuilder

func (*GroupBuilder) WithTimeout

func (gb *GroupBuilder) WithTimeout(duration time.Duration) types.GroupBuilder

func (*GroupBuilder) WithoutMiddlewares

func (gb *GroupBuilder) WithoutMiddlewares(names ...string) types.GroupBuilder

type LazyHTTPRouter

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

func NewFastHTTPRouter

func NewFastHTTPRouter(ctx context.Context, logger types.Logger) (*LazyHTTPRouter, error)

func (*LazyHTTPRouter) Add

func (r *LazyHTTPRouter) Add(method, path string, handler types.FastHTTPHandler, config *types.RouteConfig)

func (*LazyHTTPRouter) DELETE

func (r *LazyHTTPRouter) DELETE(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*LazyHTTPRouter) GET

func (*LazyHTTPRouter) GetAllRoutes

func (r *LazyHTTPRouter) GetAllRoutes() map[string]*types.RouteInfo

func (*LazyHTTPRouter) GetCompiledRoutes

func (r *LazyHTTPRouter) GetCompiledRoutes() (map[string]*types.RouteInfo, []*LazyRoute)

func (*LazyHTTPRouter) Group

func (r *LazyHTTPRouter) Group(prefix string) types.GroupBuilder

func (*LazyHTTPRouter) HEAD

func (*LazyHTTPRouter) IsRunning

func (r *LazyHTTPRouter) IsRunning() bool

func (*LazyHTTPRouter) OPTIONS

func (r *LazyHTTPRouter) OPTIONS(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*LazyHTTPRouter) PATCH

func (r *LazyHTTPRouter) PATCH(path string, handler types.FastHTTPHandler) types.RouteBuilder

func (*LazyHTTPRouter) POST

func (*LazyHTTPRouter) PUT

func (*LazyHTTPRouter) Start

func (r *LazyHTTPRouter) Start() error

func (*LazyHTTPRouter) Stop

func (r *LazyHTTPRouter) Stop() error

type LazyRoute

type LazyRoute struct {
	MethodIdx uint8
	Pattern   string
	Handler   types.FastHTTPHandler
	Config    *types.RouteConfig
}

type RouteBuilder

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

func (*RouteBuilder) Finalize

func (rb *RouteBuilder) Finalize() error

func (*RouteBuilder) WithCache

func (rb *RouteBuilder) WithCache(key string, ttl time.Duration, dependencies ...string) types.RouteBuilder

func (*RouteBuilder) WithDoc

func (rb *RouteBuilder) WithDoc(title, description, tag string, requestType, responseType interface{}) types.RouteBuilder

func (*RouteBuilder) WithMiddlewares

func (rb *RouteBuilder) WithMiddlewares(names ...string) types.RouteBuilder

func (*RouteBuilder) WithTimeout

func (rb *RouteBuilder) WithTimeout(duration time.Duration) types.RouteBuilder

func (*RouteBuilder) WithoutMiddlewares

func (rb *RouteBuilder) WithoutMiddlewares(names ...string) types.RouteBuilder

type RouterState

type RouterState int32
const (
	RouterStateStopped RouterState = iota
	RouterStateStarting
	RouterStateRunning
	RouterStateStopping
)

type State

type State int32
const (
	StateStopped State = iota
	StateStarting
	StateRunning
	StateStopping
)

Jump to

Keyboard shortcuts

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