https://github.com/farseer-go/fs
farseer-go all components of the base module, module launcher, framework initialization program(所有组件的基础模块,模块启动器,框架初始化程序)
https://github.com/farseer-go/fs
container ddd elasticsearch etcd eventbus go ioc linq mapper module orm queue rabbit rabbitmq redis
Last synced: 2 days ago
JSON representation
farseer-go all components of the base module, module launcher, framework initialization program(所有组件的基础模块,模块启动器,框架初始化程序)
- Host: GitHub
- URL: https://github.com/farseer-go/fs
- Owner: farseer-go
- License: mit
- Created: 2022-07-11T15:58:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-10T07:39:40.000Z (15 days ago)
- Last Synced: 2026-01-11T02:12:37.586Z (14 days ago)
- Topics: container, ddd, elasticsearch, etcd, eventbus, go, ioc, linq, mapper, module, orm, queue, rabbit, rabbitmq, redis
- Language: Go
- Homepage: https://farseer-go.github.io/doc
- Size: 688 KB
- Stars: 563
- Watchers: 3
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Overview
- `Document`
- [English](https://farseer-go.github.io/doc/#/en-us/)
- [中文](https://farseer-go.github.io/doc/)
- [English](https://farseer-go.github.io/doc/#/en-us/)
- `Source`
- [github](https://github.com/farseer-go/fs)




[](https://github.com/farseer-go/fs/actions/workflows/test.yml)
[](https://codecov.io/gh/farseer-go/fs)

## 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](https://github.com/FarseerNet/Farseer.Net/) 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 `. /farseer.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](https://github.com/FarseerNet/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](https://github.com/farseer-go/fs) | Basic Core Package | [](https://github.com/farseer-go/fs/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/fs) |
| [collections](https://github.com/farseer-go/collections) | Data Collection | [](https://github.com/farseer-go/collections/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/collections) |
| [webapi](https://github.com/farseer-go/webapi) | web api | [](https://github.com/farseer-go/webapi/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/webapi) |
| [async](https://github.com/farseer-go/async) | Async Programming | [](https://github.com/farseer-go/async/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/async) |
| [mapper](https://github.com/farseer-go/mapper) | Object Conversion | [](https://github.com/farseer-go/mapper/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/mapper) |
| [cacheMemory](https://github.com/farseer-go/cacheMemory) | Local Cache | [](https://github.com/farseer-go/cacheMemory/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/cacheMemory) |
| [redis](https://github.com/farseer-go/redis) | client | [](https://github.com/farseer-go/redis/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/redis) |
| [data](https://github.com/farseer-go/data) | DataBase ORM | [](https://github.com/farseer-go/data/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/data) |
| [elasticSearch](https://github.com/farseer-go/elasticSearch) | client | [](https://github.com/farseer-go/elasticSearch/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/elasticSearch) |
| [eventBus](https://github.com/farseer-go/eventBus) | eventBus | [](https://github.com/farseer-go/eventBus/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/eventBus) |
| [queue](https://github.com/farseer-go/queue) | Local Queue | [](https://github.com/farseer-go/queue/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/queue) |
| [tasks](https://github.com/farseer-go/tasks) | Local tasks | [](https://github.com/farseer-go/tasks/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/tasks) |
| [fSchedule](https://github.com/farseer-go/fSchedule) | client | [](https://github.com/farseer-go/fSchedule/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/fSchedule) |
| [utils](https://github.com/farseer-go/utils) | utils | [](https://github.com/farseer-go/utils/actions/workflows/test.yml)[](https://codecov.io/gh/farseer-go/utils) |
| [rabbit](https://github.com/farseer-go/rabbit) | rabbit client | [](https://github.com/farseer-go/rabbit/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/rabbit) |
| [etcd](https://github.com/farseer-go/etcd) | etcd client | [](https://github.com/farseer-go/etcd/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/etcd) |
| [linkTrace](https://github.com/farseer-go/linkTrace) | linkTrace | [](https://github.com/farseer-go/linkTrace/actions/workflows/build.yml)[](https://codecov.io/gh/farseer-go/linkTrace) |
| [redisStream](https://github.com/farseer-go/redisStream) | redis mq | Coming soon |
## Quick Start
_main.go_
```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](https://github.com/farseer-go/demo/tree/main/shopping) 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
[](https://github.com/farseer-go/fs/stargazers)