Categorygithub.com/jiebutech/uc
modulepackage
1.0.0
Repository: https://github.com/jiebutech/uc.git
Documentation: pkg.go.dev

# README

UC

用户中心

Feature

  • 邮箱注册/登录
  • 手机号注册/登录
  • 发送短信验证码
  • facebook 登录
  • google 登录

Install

加载依赖

go get -u github.com/jiebutech/uc

初始化数据表结构

source ./schema.sql

自定义相关功能需要实现的接口

  • 用户表 => github.com/jiebutech/uc/model.UserEntity
  • 第三方登录表 => github.com/jiebutech/uc/model.OauthUserEntity
  • 用户相关操作 => github.com/jiebutech/uc/model.UserResource
  • 验证码发送器 => github.com/jiebutech/uc/sender.SmsCodeSender
  • 邮箱验证码标题及内容模板 => github.com/jiebutech/uc/sender.CodeMessenger
  • 验证码缓存器 => github.com/jiebutech/uc/cache.Cache

扩展第三方登录实现

  1. 实现github.com/jiebutech/uc/oauth.Oauth接口, 完成登录注册的基本业务流程
  2. 实现github.com/jiebutech/uc/oauth.OauthLoginType接口, 完成登录类型的相关定义

Example

用户中心接口实现

# Packages

No description provided by the author
Package model is a generated GoMock package.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
NewOauthClient 实例化第三方登录客户端.
NewUserClient 实例化用户操作客户端.
UserAuthGinMiddleware gin 用户过滤中间件.
UserShouldAuthGinMiddleware 用户登录信息解析, 不强制登录.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author