MIT License

项目介绍

farseer-go/fs 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 545 个 Star、14 次 Fork。

仓库全名
farseer-go/fs
开源许可证
MIT License
Star 数
545
Fork 数
14
未关闭 Issue
4

README 摘要

Overview Document English 中文 English Source github Introduction A modular and complete infrastructure framework based on Golang,create modern web applications and APIs Use the most popular components available today and provide them with modular technology. The framework perfectly supports DDD domain-driven tactical design, such as warehousing repository , application-layer transactions, domain events,…

完整内容见 GitHub 原始 README 或本页 。

常见问题

fs 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 545 个 Star。

fs 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 fs 的源码?

可以直接克隆仓库:git clone https://github.com/farseer-go/fs.git,默认分支为 main;安装与运行步骤见仓库 README。

fs 最近还在维护吗?

仓库最近一次更新为 6月21日,当前有 4 个未关闭 Issue;Star 数为 545,可作为社区活跃度的参考。

关于

farseer-go all components of the base module, module launcher, framework initialization program(所有组件的基础模块,模块启动器,框架初始化程序)

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
576
价值分
331
活跃状态
活跃

语言占比

Go

Release

README

Overview

stars license go-version release Build codecov badge

Introduction

A modular and complete infrastructure framework based on Golang,create modern web applications and APIs

Use the most popular components available today and provide them with modular technology.

The framework perfectly supports DDD domain-driven tactical design, such as warehousing repository , application-layer transactions, domain events, application-layer dynamic WebAPI.

It has a mature version of .net core that has been in use for over 10 years and is great

Don’t worry about the framework making you depend on too many packages, farseer-go’s components are all separate packages and unused packages are not downloaded into your application

Features

  • Unified configuration: all configurations are consolidated into . /config.yaml

  • Elegant: all modules follow the principle of developer experience first.

  • Modularity: provides a complete modular system that allows you to develop reusable application modules.

  • Domain-driven: helps you implement a hierarchical architecture based on DDD and build a maintainable code base.

  • link tracking : if you use the framework Orm, Redis, Http, Grpc, ES, MQ, EventBus, Task, fSchedule, will implicitly implement link tracking for you and provide API request logs, slow queries.

Combined with FOPS project (automatic build, link tracing console, K8S cluster log collection) support code non-intrusive full link real-time monitoring.

Components

Package Name Description
fs Basic Core Package go-versionreleaseBuildcodecovbadge
collections Data Collection go-versionreleaseBuildcodecovbadge
webapi web api go-versionreleaseBuildcodecovbadge
async Async Programming go-versionreleaseBuildcodecovbadge
mapper Object Conversion go-versionreleaseBuildcodecovbadge
cacheMemory Local Cache go-versionreleaseBuildcodecovbadge
redis client go-versionreleaseBuildcodecovbadge
data DataBase ORM go-versionreleaseBuildcodecovbadge
elasticSearch client go-versionreleaseBuildcodecovbadge
eventBus eventBus go-versionreleaseBuildcodecovbadge
queue Local Queue go-versionreleaseBuildcodecovbadge
tasks Local tasks go-versionreleaseBuildcodecovbadge
fSchedule client go-versionreleaseBuildcodecovbadge
utils utils go-versionreleaseBuildcodecovbadge
rabbit rabbit client go-versionreleaseBuildcodecovbadge
etcd etcd client go-versionreleaseBuildcodecovbadge
linkTrace linkTrace go-versionreleaseBuildcodecovbadge
redisStream redis mq Coming soon

Quick Start

main.go

package main
import "github.com/farseer-go/fs"
import "github.com/farseer-go/fs/modules"
import "github.com/farseer-go/webapi"

func main() {
  fs.Initialize[StartupModule]("your project Name")
}

type StartupModule struct { }

func (module StartupModule) DependsModule() []modules.FarseerModule {
  return []modules.FarseerModule{webapi.Module{}}
}
func (module StartupModule) PreInitialize() { }
func (module StartupModule) Initialize() { }
func (module StartupModule) PostInitialize() { }
func (module StartupModule) Shutdown() { }

In the first line of the main function, execute fs.Initialize to start initializing the framework

After running the console prints the loading message.

2023-01-05 16:15:00 AppName:  your project Name
2023-01-05 16:15:00 AppID:    199530571963039744
2023-01-05 16:15:00 AppIP:    192.168.3.55
2023-01-05 16:15:00 HostName: stedenMacBook-Pro.local
2023-01-05 16:15:00 HostTime: 2023-01-05 16:15:00
2023-01-05 16:15:00 PID:      22131

2023-01-05 16:15:00 ---------------------------------------
2023-01-05 16:15:00 Loading Module...
2023-01-05 16:15:00 Loading Module:webapi.Module
2023-01-05 16:15:00 Loading Module:main.StartupModule
2023-01-05 16:15:00 Loaded, 11 modules in total
2023-01-05 16:15:00 ---------------------------------------
2023-01-05 16:15:00 Elapsed time:0 ms modules.FarseerKernelModule.PreInitialize()
2023-01-05 16:15:00 Elapsed time:0 ms webapi.Module.PreInitialize()
2023-01-05 16:15:00 Elapsed time:0 ms main.StartupModule.PreInitialize()
2023-01-05 16:15:00 ---------------------------------------
2023-01-05 16:15:00 Elapsed time:0 ms modules.FarseerKernelModule.Initialize()
2023-01-05 16:15:00 Elapsed time:0 ms webapi.Module.Initialize()
2023-01-05 16:15:00 Elapsed time:0 ms main.StartupModule.Initialize()
2023-01-05 16:15:00 ---------------------------------------
2023-01-05 16:15:00 Elapsed time:0 ms modules.FarseerKernelModule.PostInitialize()
2023-01-05 16:15:00 Elapsed time:0 ms webapi.Module.PostInitialize()
2023-01-05 16:15:00 Elapsed time:0 ms main.StartupModule.PostInitialize()
2023-01-05 16:15:00 ---------------------------------------
2023-01-05 16:15:00 Initialization completed, total time:0 ms 
2023-01-05 16:15:00 [Info] Web service is started:http://localhost:8888/

farseer-go framework demo

We have provided simulations of a small e-commerce website using the following techniques.

  • ddd: using domain-driven design
  • ioc: use ioc/container, do decoupling, injection, dependency inversion
  • webapi: api service, and use dynamic api technology
  • data: database operations
  • redis: redis operation
  • eventBus: event driver You can download it locally and run it

Stargazers

Stargazers repo roster for @farseer-go/fs

评论

暂无评论