fer is not Ferdian
go get github.com/kumparan/fer
It should be available as command now in terminal.
Check fer version
fer version
- Scaffold New Microservices
- Generate Service&test files and Client files From Proto
- DB migration file generator
- Generate Repository (include model)
- Gocek, checks go mod update info
- Add worker with command
- Add Nats Subscriber with command
Add .ferconfig.json
into $HOME/.ferconfig.json
, use the .ferconfig.json.example
as reference
fer generate project content-service --proto pb/example/example.proto
you can make microservices start from proto. see the proto example in pb/
folder
you need to create proto file with services RPC with path like this
pb/'$service/$protoname.proto
example (see the proto example in folder pb/
)
pb/content/content_service.proto
service ContentService{
// Topic << you must define the domain
rpc CreateTopic(CreateTopicRequest) returns (Topic) {}
rpc DeleteTopicByID(DeleteByIDRequest) returns (Empty) {}
// Story << you must define the domain
rpc CreateStory(CreateTopicRequest) returns (Topic){}
rpc DeleteStoryByID(DeleteByIDRequest) returns (Empty){}
}
and create microservices
fer generate project content-service --proto pb/example/example.proto
- new service will generated like this
-content-service/
-client/ ->(Generated From Proto)
-config/
-console/
-db/
-event/
-pb/
-repository/
-service/ ->(Generated From Proto)
-worker/
-config.yml
-config.yml.dev
-config.yml.example
-config.yml.prod
-config.yml.staging
-go.mod ->(mod is already with service name)
-go.sum
-LICENSE
-main.go
-Makefile
-README.md
You can create db migration file
fer generate migration create_story
and new migration will be created like this
db/migration/20191007130809_create_story.sql
You can create repository and model file
fer generate repository promoted_link
and new repository and model will be created like this
repository/model/promoted_link.go created
repository/promoted_link_repository.go created
fer deploy dev-a
for deployment, push deployment tag
fer create chglog vx.x.x
to generate CHANGELOG.md
fer gocek
check current working directory
fer gocek all
check all directory listed in .ferconfig.json