EVO is a Go framework for building backend services. It gives you a web server, settings, a database layer with migrations, logging, caching, messaging and many small helpers, all under one import path.
You split your code into small apps. Each app registers its own routes, models and settings. EVO wires them together and starts the server.
package main
import "github.com/getevo/evo/v2"
func main() {
if err := evo.Setup(); err != nil {
panic(err)
}
evo.Get("/hello", func(r *evo.Request) any {
return "hello world"
})
if err := evo.Run(); err != nil {
panic(err)
}
}Run it and open http://localhost:8080/hello. You get {"success":true,"data":"hello world"}.
- Getting Started
- Configuration and Settings
- Web Server
- HTTP Responses (Outcome)
- Database
- Health Checks
- MCP Server (AI agent tools)
- Shutdown Hooks
- Storage Interface
- Cache Interface
- Messaging Bus Interface
- Connectors
- Date
- Internationalization
- TPL Templates
- CURL
- Build
- Args
- Logging
- Concurrency Patterns
- STract configuration language
- Local Files
- Dot Notation
- Reflections
- Validations
- GORM based pagination
- Libraries
Every package in the lib folder:
- Application - App registration and startup order
- Args - Command-line arguments
- Async - Run work in parallel
- Build - Build info
- Connectors - Kafka, NATS and Redis clients
- Curl - HTTP client
- Date - Dates and times
- DB - Database access
- Dot - Read and write nested data with dot paths
- Errors - HTTP errors
- Frm - Error codes
- Generic - Convert any value to any type
- Gpath - Files and paths
- Is - Value checks
- JSON - JSON helpers
- Log - Logging
- MCP - Model Context Protocol types and schema
- Memo - Cache
- Outcome - HTTP responses
- Panics - Panic handling
- Ptr - Pointer helpers
- Pubsub - Publish and subscribe
- Reflections - Reflection helpers
- Scheduler - Run tasks on a schedule
- Serializer - Serialize data
- Settings - Configuration
- Shutdown - Run cleanup when the app stops
- SQLite - SQLite driver
- Storage - File storage
- Stract - STract config language
- Text - Text helpers
- Tpl - Templates
- Try - Try and catch
- Validation - Data validation
- Version - Version compare
-
Add EVO to your module:
go get github.com/getevo/evo/v2
-
Write
main.golike the example at the top. That's enough to start a server. -
Add a
config.ymlwhen you need one. It's optional. Without it, the server uses the default HTTP settings and listens on0.0.0.0:8080.Here's a config with a database and the full
HTTPsection. It turns the database on, so you also need step 4:# config.yml Database: Enabled: true Type: mysql Server: 127.0.0.1:3306 Username: root Password: password Database: mydb Debug: 3 MaxOpenConns: 100 MaxIdleConns: 10 ConnMaxLifTime: 1h SlowQueryThreshold: 500ms HTTP: Host: 0.0.0.0 Port: "8080" Network: tcp4 Prefork: false ServerHeader: EVO NG StrictRouting: false CaseSensitive: false Immutable: false UnescapePath: false ETag: false BodyLimit: 128kb Concurrency: 1024 ReadTimeout: 1s WriteTimeout: 5s IdleTimeout: 0 ReadBufferSize: 8kb WriteBufferSize: 4kb CompressedFileSuffix: .evo.gz ProxyHeader: "" GETOnly: false DisableKeepalive: false DisableDefaultDate: false DisableDefaultContentType: false DisableHeaderNormalizing: false ReduceMemoryUsage: false EnablePrintRoutes: false Recover: true
If you write an
HTTPsection, write all of it. Keys you leave out stay empty, they don't take the defaults. OnlyRecoverstays on when it's missing. See Configuration.ProxyHeaderis empty on purpose.Request.IP()already checks the common proxy headers (CF-Connecting-IP,X-Real-IP,X-Forwarded-Forand others). Set it only if your proxy uses a different header.Recover: truemeans a panic in a handler returns500and the server keeps running. -
To use a database, pass its driver to
evo.Setup:MySQL:
package main import ( "github.com/getevo/evo/v2" "github.com/getevo/evo/v2/lib/mysql" ) func main() { if err := evo.Setup(mysql.Driver{}); err != nil { panic(err) } if err := evo.Run(); err != nil { panic(err) } }
PostgreSQL: import
github.com/getevo/evo/v2/lib/pgsqland callevo.Setup(pgsql.Driver{}).SQLite: import
github.com/getevo/evo/v2/lib/sqliteand callevo.Setup(sqlite.Driver{}).Database.Typein your config must match the driver you pass.