gox

package module
v0.0.0-...-c164e30 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 16 Imported by: 0

README

Gox

An opinionated web 'framework' for Go.

This project is intended to make my life really easy when writing quick apps in Go. It's not intended to be useful for others, and thus won't be well documented or supported. Use at your own risk (of banging your head against a wall).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GormConfig = gorm.Config{
	Logger: logger.Default.LogMode(logger.Silent),
}

Functions

func Validate

func Validate(to any, c echo.Context) bool

Types

type Gox

type Gox struct {
	*echo.Echo

	DB *gorm.DB
	// contains filtered or unexported fields
}

func New

func New() *Gox

func (*Gox) AddModel

func (g *Gox) AddModel(model any)

func (*Gox) AddTemplateFunction

func (g *Gox) AddTemplateFunction(name string, fn any)

func (*Gox) AddTemplates

func (g *Gox) AddTemplates(dir fs.FS, names map[string]string)

func (*Gox) Migrate

func (g *Gox) Migrate() error

func (*Gox) RenderTemplate

func (g *Gox) RenderTemplate(name string, data any) (string, error)

func (*Gox) UseDatabase

func (g *Gox) UseDatabase(db *gorm.DB) error

func (*Gox) UsePostgreSQL

func (g *Gox) UsePostgreSQL(addr string) error

func (*Gox) UseSQLite

func (g *Gox) UseSQLite(addr string) error

func (*Gox) WithGox

func (g *Gox) WithGox(handler GoxHandlerFunc) echo.HandlerFunc

type GoxHandlerFunc

type GoxHandlerFunc func(echo.Context, *Gox) error

Jump to

Keyboard shortcuts

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