miniblog

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT

README

miniblog 项目

miniblog(微型博客) 是一个 Go 语言入门项目,用来完成用户注册、博客创建等业务。miniblog 入门但不简单:

  • 入门: 适用于刚学习完 Go 基础语法,零项目开发经验的 Go 开发者;
  • 不简单: 本项目来自于一线企业的大型线上项目,项目本身是一个企业级的项目,学习完之后,完全可以用来作为企业级项目的开发脚手架。

miniblog 实现了以下 2 类功能:

  • 用户管理: 支持 用户注册、用户登录、获取用户列表、获取用户详情、更新用户信息、修改用户密码、注销用户 7 种用户操作;
  • 博客管理: 支持 创建博客、获取博客列表、获取博客详情、更新博客内容、删除博客、批量删除博客 6 种博客操作。

本项目适合人群

  • 刚学习完 Go 基础语法,想快速学习,以参与公司 Go 语言开发工作的开发者;
  • 掌握 Go 基础语法,零 Go 应用开发经验,想通过完整的实战,快速、系统的学习 Go 开发的开发者;
  • 有意从事 Go 应用开发,但尚未入门或入门尚浅的开发者;
  • 有过 Go 应用开发经验,但想了解某一部分开发方法的开发者。

课程:

建议: 先学习掘金课程,再学习极客时间课程,带你从入门进阶为高级。

Features

  • 使用了简洁架构;
  • 使用众多常用的 Go 包:gorm, casbin, govalidator, jwt-go, gin, cobra, viper, pflag, zap, pprof, grpc, protobuf 等;
  • 规范的目录结构,使用 project-layout 目录规范;
  • 具备认证(JWT)和授权功能(casbin);
  • 独立设计的 log 包、error 包;
  • 使用高质量的 Makefile 管理项目;
  • 静态代码检查;
  • 带有单元测试、性能测试、模糊测试、Mock 测试测试案例;
  • 丰富的 Web 功能(调用链、优雅关停、中间件、跨域、异常恢复等);
    • HTTP、HTTPS、gRPC 服务器实现;
    • JSON、Protobuf 数据交换格式实现;
  • 项目遵循众多开发规范:代码规范、版本规范、接口规范、日志规范、错误规范、提交规范等;
  • 访问 MySQL 编程实现;
  • 实现的业务功能:用户管理、博客管理;
  • RESTful API 设计规范;
  • OpenAPI 3.0/Swagger 2.0 API 文档;
  • 配套有高质量的掘金课程;

提示:以上这些功能点,是我根据一线 Go 开发经验,所挑选的核心功能,这些功能也涵盖了 Go 企业应用开发中,大部分的核心功能。通过这些功能可以确保在学习完本项目后,你能够开发一个高质量的企业应用。

Installation

$ git clone https://github.com/marmotedu/miniblog.git
$ go work use miniblog # 如果 Go 版本 > 1.18
$ cd miniblog
$ make # 编译源码

Documentation

Feedback

如果您有任何反馈,请通过 nosbelm@qq.com 与我联系。

Contributing

欢迎你贡献代码和 Star !

开发规范

本项目遵循以下开发规范:miniblog 项目开发规范

Authors

  • @孔令飞

  • 可加我微信 nightskong 拉你进讨论群

License

MIT

Directories

Path Synopsis
cmd
examples
internal
miniblog/biz
Package biz is the place where you can implements more complex business logic.
Package biz is the place where you can implements more complex business logic.
miniblog/biz/post
Package post is a generated GoMock package.
Package post is a generated GoMock package.
miniblog/store
Package store defines the storage interface for miniblog.
Package store defines the storage interface for miniblog.
pkg/core
Package core implements some core functions used by apimachinery.
Package core implements some core functions used by apimachinery.
pkg/log
Package log is a log package used by miniblog project.
Package log is a log package used by miniblog project.
pkg
db
Package db provide useful functions to create mysql instance.
Package db provide useful functions to create mysql instance.
version
Package version supplies version information collected at build time to applications.
Package version supplies version information collected at build time to applications.
version/verflag
Package verflag defines utility functions to handle command line flags related to version of IAM.
Package verflag defines utility functions to handle command line flags related to version of IAM.

Jump to

Keyboard shortcuts

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