full

command
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package main 是 xlgo 的完整示例:MySQL + Redis + JWT + 一个 user CRUD。

运行前需准备:

  • MySQL(config.yaml 中 database 配置)
  • Redis(config.yaml 中 redis 配置)

启动后会自动迁移 user 表。访问:

POST /api/v1/login           {"username":"alice","password":"secret"}  → 返回 token
GET  /api/v1/users/:id       (需 Authorization: Bearer <token>)
POST /api/v1/users           (创建用户)

运行:

go run ./examples/full

Jump to

Keyboard shortcuts

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