Versions in this module Expand all Collapse all v0 v0.1.1 Feb 27, 2024 Changes in this version type Context + func (ctx *Context) Bind(target interface{}) error v0.1.0 Feb 26, 2024 Changes in this version + type Context struct + Database *Database + func (ctx *Context) BindJSON(target interface{}) error + func (ctx *Context) Get(key string) any + func (ctx *Context) GetFormValue(name string) (string, error) + func (ctx *Context) GetQueryParam(name string) (string, error) + func (ctx *Context) GetRouteParam(name string) (string, error) + func (ctx *Context) Set(key string, value any) + func (ctx *Context) WriteJSON(statusCode int, j JSON) error + func (ctx *Context) WriteString(statusCode int, s string) error + type DBModel struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + UpdatedAt time.Time + type DBType string + const MySQL + const PostgreSQL + const SQLite + type Database struct + ORM *gorm.DB + func NewMySQLDatabase(cfg MySQLConfig) *Database + func NewPostgreSQLDatabase(cfg PostgreSQLConfig) *Database + func NewSQLiteDatabase(cfg SQLiteConfig) *Database + func (db *Database) Migrate(model interface{}) + type Handler func(ctx *Context) error + type JSON map[string]any + type Middleware func(next Handler) Handler + type MySQLConfig struct + DBHost string + DBName string + DBPassword string + DBPort int + DBUsername string + type PostgreSQLConfig struct + DBHost string + DBName string + DBPassword string + DBPort int + DBUsername string + type Proton struct + func New() *Proton + func NewWithDatabase(db *Database) *Proton + func (p *Proton) DELETE(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) GET(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) HEAD(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) OPTIONS(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) PATCH(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) POST(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) PUT(path string, handler Handler, middlewares ...Middleware) + func (p *Proton) Start(address string) error + func (p *Proton) Static(path string, dirPath string) + func (p *Proton) UseMiddleware(middlewares ...Middleware) + type SQLiteConfig struct + DBFile string