Documentation ¶
Index ¶
- Constants
- type App
- func (app *App) DB() *db.DB
- func (app *App) DbFunc(c context.Context, config *db.Config) (*db.DB, error)
- func (app *App) FS() fsys.FS
- func (app *App) HandleSignals()
- func (app *App) Inertia() *inertia.Inertia
- func (app *App) Plugin(plugin Plugin) Plugin
- func (app *App) Plugins() PluginRegistry
- func (app *App) RegisterRoutes(fn RouteRegistrarFunc)
- func (app *App) Router() *Router
- func (app *App) Run()
- func (app *App) Session() *session.Session
- func (app *App) SetDB(db *db.DB)
- func (app *App) SetDbFunc(dbFunc func(c context.Context, config *db.Config) (*db.DB, error))
- func (app *App) SetSession(session *session.Session)
- type AppHooks
- type AppManager
- type AuthServiceProvider
- type BaseInput
- type BaseServiceProvider
- type Context
- func (c *Context) Alert(typ string, message string) *res.AlertMessage
- func (c *Context) App() AppManager
- func (c *Context) AuthUser() interface{}
- func (c *Context) Back(status int) error
- func (c *Context) BadRequest(err error) error
- func (c *Context) Body() (map[string][]string, error)
- func (c *Context) Cookie(name string) *http.Cookie
- func (c *Context) DB() *db.DB
- func (c *Context) DecodeJSON(v interface{}) error
- func (c *Context) Download(path string, filename string) error
- func (c *Context) Error(status int, err error) error
- func (c *Context) FS() fsys.FS
- func (c *Context) File(path string, headers ...map[string][]string) error
- func (c *Context) Forbidden(err error) error
- func (c *Context) Form() (map[string][]string, error)
- func (c *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error)
- func (c *Context) Get(key string) any
- func (c *Context) GetHeader(key string) string
- func (c *Context) GetInput() any
- func (c *Context) GetSession(key string) any
- func (c *Context) GetSessionString(key string) string
- func (c *Context) HTML(status int, body []byte) error
- func (c *Context) HasFile(key string) bool
- func (c *Context) HasFormURLEncodedRequest() bool
- func (c *Context) HasMultiPartRequest() bool
- func (c *Context) I() *inertia.Inertia
- func (c *Context) Inertia(status int, filePath string, props map[string]any) error
- func (c *Context) Input(inputStruct any) any
- func (c *Context) InternalServerError(err error) error
- func (c *Context) IsInertiaRequest() bool
- func (c *Context) IsReading() bool
- func (c *Context) JSON(status int, body M) error
- func (c *Context) Next() error
- func (c *Context) NotFound(err error) error
- func (c *Context) PageExpired() error
- func (c *Context) Param(key string) string
- func (c *Context) ParseInput(inputStruct any) error
- func (c *Context) Plugin(plugin Plugin) Plugin
- func (c *Context) PopSession(key string) any
- func (c *Context) PopSessionString(key string) string
- func (c *Context) PutSession(key string, value any) *Context
- func (c *Context) Query(key string) string
- func (c *Context) Redirect(status int, url string) error
- func (c *Context) Referer() string
- func (c *Context) Render(status int, tmplPath string, data *res.TemplateData) error
- func (c *Context) Request() *http.Request
- func (c *Context) RequestContext() context.Context
- func (c *Context) Respond(r *R) error
- func (c *Context) ResponseWriter() http.ResponseWriter
- func (c *Context) Set(key string, value interface{})
- func (c *Context) SetCookie(name string, value string, maxAge int, path string, domain string, secure bool, ...)
- func (c *Context) SetHeader(key string, value string)
- func (c *Context) SetInput(inputStruct any) error
- func (c *Context) SetRequest(r *http.Request)
- func (c *Context) StorageFile(path string, headers ...map[string][]string) error
- func (c *Context) Templ(status int, component templ.Component) error
- func (c *Context) Text(status int, body []byte) error
- func (c *Context) Unauthorized(err error) error
- func (c *Context) Upload(key string, dir string, filename ...string) (*os.File, error)
- func (c *Context) Validate(body req.Validator) error
- func (c *Context) ValidationError(err error) error
- func (c *Context) WantsHTML() bool
- func (c *Context) WantsJSON() bool
- func (c *Context) With(key string, message string) *Context
- func (c *Context) WithData(data map[string]any) *Context
- func (c *Context) WithError(message string) *Context
- func (c *Context) WithErrors(errors shared.ValidationErrors) *Context
- func (c *Context) WithInfo(message string) *Context
- func (c *Context) WithInput() *Context
- func (c *Context) WithSuccess(message string) *Context
- func (c *Context) WithWarning(message string) *Context
- type DatabaseServiceProvider
- type FileInput
- type Group
- func (g *Group) Delete(pattern string, handlers ...Handler) *Route
- func (g *Group) Get(pattern string, handlers ...Handler) *Route
- func (g *Group) Group(prefix string) *Group
- func (g *Group) Patch(pattern string, handlers ...Handler) *Route
- func (g *Group) Post(pattern string, handlers ...Handler) *Route
- func (g *Group) Put(pattern string, handlers ...Handler) *Route
- func (g *Group) UseAfter(handlers ...Handler)
- func (g *Group) UseBefore(handlers ...Handler)
- type HTTPMiddleware
- type Handler
- type InertiaFlashProvider
- type M
- type Middleware
- type OptFunc
- type Options
- type Plugin
- type PluginID
- type PluginRegistry
- type R
- type Route
- type RouteRegistrarFunc
- type Router
- func (r *Router) Connect(pattern string, handlers ...Handler) *Route
- func (r *Router) Delete(pattern string, handlers ...Handler) *Route
- func (r *Router) Get(pattern string, handlers ...Handler) *Route
- func (r *Router) Group(prefix string) *Group
- func (r *Router) Handle(pattern string, handler http.Handler)
- func (r *Router) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (r *Router) HasRoute(method string, pattern string) bool
- func (r *Router) Head(pattern string, handlers ...Handler) *Route
- func (r *Router) Options(pattern string, handlers ...Handler) *Route
- func (r *Router) Patch(pattern string, handlers ...Handler) *Route
- func (r *Router) Post(pattern string, handlers ...Handler) *Route
- func (r *Router) Put(pattern string, handlers ...Handler) *Route
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Trace(pattern string, handlers ...Handler) *Route
- func (r *Router) Use(middlewares ...HTTPMiddleware)
- func (r *Router) UseAfter(handlers ...Handler)
- func (r *Router) UseBefore(handlers ...Handler)
- type ServiceProvider
- type SessionServiceProvider
- type StorageServiceProvider
- type VField
- func (f *VField) ActiveURL() *VField
- func (f *VField) AfterDate(afterDate time.Time) *VField
- func (f *VField) Alpha() *VField
- func (f *VField) AlphaDash() *VField
- func (f *VField) AlphaNumeric() *VField
- func (f *VField) Ascii() *VField
- func (f *VField) BeforeDate(beforeDate time.Time) *VField
- func (f *VField) Between(min, max int) *VField
- func (f *VField) Boolean() *VField
- func (f *VField) Contains(substring string) *VField
- func (f *VField) Custom(validateFunc func(v interface{}) (bool, string)) *VField
- func (f *VField) Date(layout string) *VField
- func (f *VField) Dimensions(width, height int) *VField
- func (f *VField) Distinct() *VField
- func (f *VField) Email() *VField
- func (f *VField) EndsWith(suffix string) *VField
- func (f *VField) Equals(value interface{}) *VField
- func (f *VField) Filled() *VField
- func (f *VField) ForEach(rules ...func(*VField) *VField) *VField
- func (f *VField) HexColor() *VField
- func (f *VField) IP() *VField
- func (f *VField) In(validValues []string) *VField
- func (f *VField) JSON() *VField
- func (f *VField) MacAddress() *VField
- func (f *VField) Max(max int) *VField
- func (f *VField) MimeTypes(allowedTypes []string) *VField
- func (f *VField) Min(min int) *VField
- func (f *VField) Name() string
- func (f *VField) Numeric() *VField
- func (f *VField) Regex(pattern string) *VField
- func (f *VField) Required() *VField
- func (f *VField) SetValue(value interface{}) *VField
- func (f *VField) StartsWith(prefix string) *VField
- func (f *VField) Timezone() *VField
- func (f *VField) ULID() *VField
- func (f *VField) URL() *VField
- func (f *VField) UUID() *VField
- func (f *VField) Unique(table string, column string, whereClauses ...map[string]interface{}) *VField
- func (f *VField) Value() interface{}
- type Validator
Constants ¶
const HTTPInKey = "input"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) HandleSignals ¶
func (app *App) HandleSignals()
func (*App) Plugins ¶
func (app *App) Plugins() PluginRegistry
func (*App) RegisterRoutes ¶
func (app *App) RegisterRoutes(fn RouteRegistrarFunc)
func (*App) SetSession ¶
type AppManager ¶
type AuthServiceProvider ¶
type AuthServiceProvider struct {
*BaseServiceProvider
}
func (*AuthServiceProvider) Boot ¶
func (provider *AuthServiceProvider) Boot()
func (*AuthServiceProvider) Register ¶
func (provider *AuthServiceProvider) Register(app *App)
type BaseInput ¶
type BaseInput struct { App AppManager Ctx *Context Validator *Validator }
type BaseServiceProvider ¶
type BaseServiceProvider struct {
App *App
}
func (*BaseServiceProvider) Publishes ¶
func (p *BaseServiceProvider) Publishes()
type Context ¶
func (*Context) App ¶
func (c *Context) App() AppManager
func (*Context) BadRequest ¶
func (*Context) DecodeJSON ¶
func (*Context) GetSession ¶
func (*Context) GetSessionString ¶
func (*Context) HasFormURLEncodedRequest ¶
func (*Context) HasMultiPartRequest ¶
func (*Context) InternalServerError ¶
func (*Context) IsInertiaRequest ¶
func (*Context) PageExpired ¶
func (*Context) ParseInput ¶
func (*Context) PopSession ¶
func (*Context) PopSessionString ¶
func (*Context) RequestContext ¶
func (*Context) ResponseWriter ¶
func (c *Context) ResponseWriter() http.ResponseWriter
func (*Context) SetCookie ¶
func (c *Context) SetCookie(name string, value string, maxAge int, path string, domain string, secure bool, httpOnly bool)
SetCookie sets a cookie on the response writer Example: // c.SetCookie("jwt", token, 60*60*24*7, "/", "", false, true)
func (*Context) SetRequest ¶
func (*Context) StorageFile ¶
func (*Context) Unauthorized ¶
func (*Context) ValidationError ¶
func (*Context) WithErrors ¶
func (c *Context) WithErrors(errors shared.ValidationErrors) *Context
func (*Context) WithSuccess ¶
func (*Context) WithWarning ¶
type DatabaseServiceProvider ¶
type DatabaseServiceProvider struct {
*BaseServiceProvider
}
func (*DatabaseServiceProvider) Boot ¶
func (provider *DatabaseServiceProvider) Boot()
func (*DatabaseServiceProvider) Register ¶
func (provider *DatabaseServiceProvider) Register(app *App)
type InertiaFlashProvider ¶
type InertiaFlashProvider struct {
// contains filtered or unexported fields
}
func NewInertiaFlashProvider ¶
func NewInertiaFlashProvider() *InertiaFlashProvider
func (*InertiaFlashProvider) FlashErrors ¶
func (p *InertiaFlashProvider) FlashErrors(ctx context.Context, errors inertia.ValidationErrors) error
func (*InertiaFlashProvider) GetErrors ¶
func (p *InertiaFlashProvider) GetErrors(ctx context.Context) (inertia.ValidationErrors, error)
type Middleware ¶
type OptFunc ¶
type OptFunc func(opts *Options)
func WithInertia ¶
func WithPlugins ¶
func WithProviders ¶
func WithProviders(providers []ServiceProvider) OptFunc
func WithSession ¶
type Plugin ¶
type Plugin interface { Boot(a AppManager) error InstallCommand() *cobra.Command Commands() []*cobra.Command EventListeners() map[string]func() PublishableMigrations() map[string][]byte PublishableModels() map[string][]byte PublishableTemplates() map[string][]byte Middlewares() []HTTPMiddleware Routes() []*Route Webhooks() []string }
type PluginRegistry ¶
type Route ¶
type RouteRegistrarFunc ¶
type RouteRegistrarFunc func(r *Router)
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) HandleFunc ¶
func (*Router) Use ¶
func (r *Router) Use(middlewares ...HTTPMiddleware)
Use adds one or more standard net/http middleware to the router
type ServiceProvider ¶
type ServiceProvider interface { Register(app *App) Boot() }
type SessionServiceProvider ¶
type SessionServiceProvider struct {
*BaseServiceProvider
}
func (*SessionServiceProvider) Boot ¶
func (provider *SessionServiceProvider) Boot()
func (*SessionServiceProvider) Register ¶
func (provider *SessionServiceProvider) Register(app *App)
type StorageServiceProvider ¶
type StorageServiceProvider struct {
BaseServiceProvider
}
func (*StorageServiceProvider) Boot ¶
func (provider *StorageServiceProvider) Boot()
func (*StorageServiceProvider) Register ¶
func (provider *StorageServiceProvider) Register(app *App)
type VField ¶
type VField struct {
// contains filtered or unexported fields
}
func (*VField) AlphaDash ¶
AlphaDash checks if the string contains only alpha-numeric characters, dashes, or underscores
func (*VField) AlphaNumeric ¶
AlphaNumeric checks if the value contains only alphanumeric characters
func (*VField) BeforeDate ¶
BeforeDate checks if the date is before the specified date
func (*VField) Dimensions ¶
Dimensions checks if the image file has the specified dimensions
func (*VField) Filled ¶
Filled checks if the value is not empty (for strings, slices, maps, and pointers)
func (*VField) MacAddress ¶
MacAddress checks if the string is a valid MAC address
func (*VField) StartsWith ¶
StartsWith checks if the string starts with the specified substring
type Validator ¶
type Validator struct { AppManager Errors shared.ValidationErrors }
func NewValidator ¶
func NewValidator(app AppManager) *Validator