konduktor/go/README.md
Илья Глазунов 8f5b9a5cd1 go implementation
2025-12-11 16:52:13 +03:00

2.6 KiB

Konduktor (Go)

High-performance HTTP web server with extensible routing and process orchestration. (Previously known as PyServe in Python)

Project Structure

go/
├── cmd/
│   ├── konduktor/        # Main server binary
│   └── konduktorctl/     # CLI management tool
├── internal/
│   ├── config/           # Configuration management
│   ├── logging/          # Structured logging
│   ├── middleware/       # HTTP middleware
│   ├── routing/          # HTTP routing
│   ├── extensions/       # Extension system (TODO)
│   └── process/          # Process management (TODO)
├── pkg/                  # Public packages (TODO)
├── go.mod
├── go.sum
└── Makefile

Building

cd go

# Download dependencies
make deps

# Build all binaries
make build

# Or build individually
make build-konduktor
make build-konduktorctl

Running

# Run with default config
./bin/konduktor

# Run with custom config
./bin/konduktor -c ../config.yaml

# Run with flags
./bin/konduktor --host 127.0.0.1 --port 3000 --debug

CLI Commands (konduktorctl)

# Start services
konduktorctl up

# Stop services
konduktorctl down

# View status
konduktorctl status

# View logs
konduktorctl logs -f

# Health check
konduktorctl health

# Scale services
konduktorctl scale api=3

# Configuration management
konduktorctl config show
konduktorctl config validate

# Initialize new project
konduktorctl init

Configuration

Uses the same YAML configuration format as the Python version:

server:
  host: 0.0.0.0
  port: 8080
  
http:
  static_dir: ./static
  templates_dir: ./templates

ssl:
  enabled: false
  cert_file: ./ssl/cert.pem
  key_file: ./ssl/key.pem

logging:
  level: INFO
  console_output: true

extensions:
  - type: routing
    config:
      regex_locations:
        "=/health":
          return: "200 OK"

Development

# Format code
make fmt

# Run linter
make lint

# Run tests
make test

# Run with coverage
make test-coverage

Migration from Python

This is a gradual rewrite of PyServe to Go. The project is now called Konduktor.

Completed

  • Basic project structure
  • Configuration loading
  • HTTP server with graceful shutdown
  • Basic routing
  • Middleware (access log, recovery, server header)
  • CLI structure (konduktor, konduktorctl)

TODO

  • Extension system
  • Regex routing
  • Reverse proxy
  • Process orchestration
  • ASGI/WSGI adapter support
  • WebSocket support
  • Hot reload
  • Metrics and monitoring