# go_user_authorized **Repository Path**: easynulls/go_user_authorized ## Basic Information - **Project Name**: go_user_authorized - **Description**: 用户认证,jwt权限分发 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-19 - **Last Updated**: 2024-09-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 服务端配置说明 该配置文件用于配置服务端的各种参数,包括服务器设置、数据库设置以及 JWT 设置。 ## 配置结构 - **ServerConfig**: 服务器配置 - `Port`: 服务器端口号 - `Address`: 服务器地址 - **DatabaseConfig**: 数据库配置 - `Username`: 数据库用户名 - `Password`: 数据库密码 - `Port`: 数据库端口号 - `Address`: 数据库地址 - `Charset`: 数据库字符集 - `DatabaseName`: 数据库名称 - `Tls`: 是否启用 TLS - **JwtConfig**: JWT 配置 - `SecretKey`: JWT 密钥 - `ContextKey`: JWT 上下文键名 - `WhiteList`: JWT 白名单,允许无需验证的路径列表 - `TokenLookup`: JWT 令牌查找方式 ## 配置示例 ```yaml server: port: 8080 address: localhost database: username: root password: password port: "3306" address: localhost charset: utf8mb4 database-name: my_database tls: true jwt: secret-key: my_secret_key context-key: user white-list: - /login - /public token-lookup: "header:Authorization query:token cookie:jwt" ``` ## 常用指令 ```shell swag init . # 重新生成swagger文档 go get -u # 更新依赖 ```