core

package
v0.0.0-...-45e3e7d Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTEXT       = "/*ctx.Context"
	WS_CONNECTION = "/*websocket.Conn"
	REQUEST       = "/*http.Request"
	RESPONSE      = "net/http/http.ResponseWriter"
	BODY          = "github.com/dangduoc08/ginject/ctx/ctx.Body"
	FORM          = "github.com/dangduoc08/ginject/ctx/ctx.Form"
	QUERY         = "github.com/dangduoc08/ginject/ctx/ctx.Query"
	HEADER        = "github.com/dangduoc08/ginject/ctx/ctx.Header"
	PARAM         = "github.com/dangduoc08/ginject/ctx/ctx.Param"
	FILE          = "github.com/dangduoc08/ginject/ctx/ctx.File"
	WS_PAYLOAD    = "github.com/dangduoc08/ginject/ctx/ctx.WSPayload"
	NEXT          = "/func()"
	REDIRECT      = "/func(string)"
)

link to aliases

Variables

This section is empty.

Functions

func ModuleBuilder

func ModuleBuilder() *moduleBuilder

Types

type App

type App struct {
	Logger common.Logger
	// contains filtered or unexported fields
}

func New

func New() *App

func (*App) BindGlobalExceptionFilters

func (app *App) BindGlobalExceptionFilters(exceptionFilters ...common.ExceptionFilterable) *App

func (*App) BindGlobalGuards

func (app *App) BindGlobalGuards(guarders ...common.Guarder) *App

func (*App) BindGlobalInterceptors

func (app *App) BindGlobalInterceptors(interceptors ...common.Interceptable) *App

func (*App) BindGlobalMiddlewares

func (app *App) BindGlobalMiddlewares(middlewares ...common.MiddlewareFn) *App

func (*App) Create

func (app *App) Create(m *Module)

func (*App) EnableDevtool

func (app *App) EnableDevtool() *App

func (*App) EnableVersioning

func (app *App) EnableVersioning(v versioning.Versioning) *App

func (*App) Get

func (app *App) Get(p Provider) any

func (*App) Listen

func (app *App) Listen(port int) error

func (*App) ServeHTTP

func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*App) UseLogger

func (app *App) UseLogger(logger common.Logger) *App

type Controller

type Controller interface {
	NewController() Controller
}

type Module

type Module struct {
	*sync.Mutex

	IsGlobal bool
	OnInit   func()

	// store REST module exception filters
	RESTExceptionFilters []common.RESTLayer

	// store REST module middlewares
	RESTMiddlewares []common.RESTLayer

	// store REST module guards
	RESTGuards []common.RESTLayer

	// store REST module interceptors
	RESTInterceptors []common.RESTLayer

	// store REST main handlers
	RESTMainHandlers []common.RESTLayer

	// store WS module middlewares
	WSMiddlewares []struct {
		Subprotocol string
		EventName   string
		Handler     any
		// contains filtered or unexported fields
	}

	// store WS module guards
	WSGuards []struct {
		Subprotocol string
		EventName   string
		Handler     any
	}

	// store WS module interceptors
	WSInterceptors []struct {
		Subprotocol string
		EventName   string
		Handler     any
	}

	// store WS module exception filters
	WSExceptionFilters []struct {
		Subprotocol string
		EventName   string
		Handler     any
	}

	// store WS main handlers
	WSMainHandlers []struct {
		Subprotocol string
		EventName   string
		Handler     any
	}
	// contains filtered or unexported fields
}

func (*Module) ID

func (m *Module) ID() string

func (*Module) NewModule

func (m *Module) NewModule() *Module

func (*Module) Prefix

func (m *Module) Prefix(prefix string) *Module

type Provider

type Provider interface {
	NewProvider() Provider
}

type WSCommonLayer

type WSCommonLayer struct {
	// controllerPath string
	// name           string
	Subprotocol string
	EventName   string
	Handler     any
}

type WSMiddlewareLayer

type WSMiddlewareLayer struct {
	// controllerPath string
	// handlerName    string
	Subprotocol string
	EventName   string
	Handlers    []func(*ctx.Context)
}

fix later change to private fields handle for devtool

type WithValueKey

type WithValueKey string

Jump to

Keyboard shortcuts

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