swiftapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPathMatcher

func NewPathMatcher(original string, regex *regexp.Regexp, paramName []string) pathMatcher

Types

type APIRoute

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

func (*APIRoute) Wrap

func (a *APIRoute) Wrap(middlewares ...types.Middleware)

type APIRouter

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

func (*APIRouter) AddRoute

func (a *APIRouter) AddRoute(
	path string,
	handler interface{},
	methods ...string,
) types.IAPIRoute

func (*APIRouter) AddWebsocketRoute

func (a *APIRouter) AddWebsocketRoute(
	path string,
	handler interface{},
	origin func(r *http.Request) bool,
	methods ...string,
) types.IAPIRoute

func (*APIRouter) DELETE added in v1.0.0

func (a *APIRouter) DELETE(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) GET added in v1.0.0

func (a *APIRouter) GET(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) OPTIONS added in v1.0.0

func (a *APIRouter) OPTIONS(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) PATCH added in v1.0.0

func (a *APIRouter) PATCH(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) POST added in v1.0.0

func (a *APIRouter) POST(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) PUT added in v1.0.0

func (a *APIRouter) PUT(
	path string,
	handler interface{},
) types.IAPIRoute

func (*APIRouter) Prefix

func (a *APIRouter) Prefix(prefix string)

func (*APIRouter) Secure

func (a *APIRouter) Secure(authorization bool)

func (*APIRouter) Version

func (a *APIRouter) Version(version string)

func (*APIRouter) WEBSOCKET added in v1.0.0

func (a *APIRouter) WEBSOCKET(
	path string,
	handler interface{},
	origin func(r *http.Request) bool,
) types.IAPIRoute

func (*APIRouter) Wrap

func (a *APIRouter) Wrap(middlewares ...types.Middleware)

type Application

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

func NewApplication

func NewApplication() *Application

func (*Application) AddMiddleware

func (s *Application) AddMiddleware(middleware types.Middleware)

func (*Application) AddRouter

func (s *Application) AddRouter(rtrg func(types.IAPIRouter))

func (*Application) Build

func (s *Application) Build(port int) types.IApplication

func (*Application) CSRF

func (s *Application) CSRF() types.ICSRFBuilder

func (*Application) Cors

func (s *Application) Cors() types.ICORSBuilder

func (*Application) Di

func (*Application) GetLogger

func (s *Application) GetLogger() *zap.Logger

func (*Application) HTTPSRedirect

func (s *Application) HTTPSRedirect() types.IHTTPSRedirectBuilder

func (*Application) Include

func (s *Application) Include() types.IIncludeBuilder

func (*Application) JWTBearer

func (s *Application) JWTBearer() types.IJWTBuilder

func (*Application) Mux

func (s *Application) Mux() http.Handler

func (*Application) RateLimiter

func (s *Application) RateLimiter() types.IRateLimiterBuilder

func (*Application) Sanitization

func (s *Application) Sanitization() types.ISanitizationBuilder

func (*Application) SetJwtConfig

func (s *Application) SetJwtConfig(jwtConfig types.IJWTConfig)

type Mux

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

func (*Mux) ServeHTTP

func (m *Mux) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Mux) SetDig

func (m *Mux) SetDig(dig types.IDigContainer)

func (*Mux) SetGlobalMiddlewares

func (m *Mux) SetGlobalMiddlewares(middlewares []types.Middleware)

func (*Mux) SetJwtConfig

func (m *Mux) SetJwtConfig(jwtConfig types.IJWTConfig)

func (*Mux) SetLogger

func (m *Mux) SetLogger(Logger *zap.Logger)

func (*Mux) SetRouters

func (m *Mux) SetRouters(routers []*APIRouter)

func (*Mux) SetStaticFile

func (m *Mux) SetStaticFile(static map[string]string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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