framework

package
v0.0.0-...-11d1d31 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFramework

func RegisterFramework(name string, factory func() Framework)

Types

type Framework

type Framework interface {
	Register(path string, method string, handler FrameworkHandler)

	ListenAndServe(addr string) error
	Shutdown() error

	GetNativeApp() interface{}
	GetOpenAPICompatiblePathPattern(path string) string

	TestRequest(req *http.Request) (*http.Response, error)
}

func GetFramework

func GetFramework(name string) Framework

type FrameworkHandler

type FrameworkHandler func(req FrameworkRequest, res FrameworkResponse, ctx *context.Context) error

type FrameworkRequest

type FrameworkRequest interface {
	ParseJSONBody(target interface{}) error
	GetHeader(key string) string
	GetPathParam(key string) string
	GetQueryParam(key string) string
	GetFormValue(key string) string
	GetCookieValue(key string) string
	GetFile(key string) (*multipart.FileHeader, error)
}

type FrameworkResponse

type FrameworkResponse interface {
	SetHeader(key string, value string)
	SetCookie(cookie http.Cookie)
	SetStatusCode(statusCode int)
	SendJSON(data interface{}) error
	SendString(data string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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