Skip to Content
Steel is in alpha 🎉
Introduction

Steel Documentation

Welcome to Steel, a high-performance HTTP router for Go that makes building APIs a joy. With automatic OpenAPI documentation, real-time WebSocket/SSE support, and comprehensive testing utilities, Steel helps you build robust APIs faster.

Why Steel?

Quick Example

Here’s a complete API server in just a few lines:

package main import ( "fmt" "log" "net/http" "github.com/xraph/steel" ) type User struct { ID int `json:"id" path:"id" description:"User ID"` Name string `json:"name" query:"name" description:"User name"` } type UserResponse struct { ID int `json:"id" description:"User ID"` Name string `json:"name" description:"User name"` Message string `json:"message" description:"Welcome message"` } func main() { r := steel.NewRouter() // Add middleware r.Use(steel.Logger, steel.Recoverer) // Opinionated handler with automatic OpenAPI generation r.OpinionatedGET("/users/:id", func(ctx *steel.Context, req User) (*UserResponse, error) { return &UserResponse{ ID: req.ID, Name: req.Name, Message: fmt.Sprintf("Welcome, %s!", req.Name), }, nil }, steel.WithSummary("Get User"), steel.WithTags("users")) // Enable automatic OpenAPI documentation r.EnableOpenAPI() log.Println("Server starting on :8080") log.Println("API docs available at http://localhost:8080/openapi/docs") log.Fatal(http.ListenAndServe(":8080", r)) }

Visit http://localhost:8080/openapi/docs to see your automatically generated API documentation!

Key Features

🏗️ Architecture Highlights

  • Radix Tree Routing: Efficient O(log n) route matching
  • Zero Allocations: Parameter extraction without memory allocations
  • Reflection-Based Binding: Automatic request binding using Go reflection
  • Real-time Documentation: OpenAPI and AsyncAPI specs generated on-the-fly
  • Connection Management: Built-in WebSocket and SSE connection pooling

📊 Documentation Viewers

Steel supports multiple documentation viewers out of the box:

  • Swagger UI - Interactive API documentation with try-it-out
  • ReDoc - Beautiful, responsive documentation
  • Scalar - Modern documentation with excellent UX
  • Stoplight Elements - Comprehensive documentation platform

🔧 Developer Experience

  • Type Safety: Full Go type system integration
  • Error Handling: Rich error types with automatic documentation
  • Testing: Built-in testing utilities and load testing
  • Debugging: Route inspection and middleware debugging tools
  • Hot Reload: Development server with automatic reloading

Getting Started

Ready to build your first API? Let’s get started!

Prerequisites: Go 1.24+ is required. Steel takes advantage of the latest Go features for optimal performance.

  1. Install Steel
go get github.com/xraph/steel
  1. Follow the Getting Started Guide

  2. Explore Examples

  3. Read the API Reference

Community & Support


Ready to forge your next API? Let’s dive into the Getting Started Guide!

Last updated on