Curated list of Go design patterns, recipes and idioms
Go Patterns
A curated collection of idiomatic design & application patterns for Go language.
Creational Patterns
Pattern
Description
Status
Abstract Factory
Provi
Add producer_consumer.md and update the README.md in root dir.
Add producer_consumer package:
We can use assign tasks to producer after producer starts.
Producer has limit buffer for task. If the buffer is full and no
consumer to take, the producer will ignore the task.
Consumer needs to regiester if it wants to do task for producer.
All the communication is based on RPC.
Add example for producer_consumer package.
The example will show the case that the buffer of producer is full.
It works now :)
The problem was that I tried to make an remote branch to compare to master branch. But I had no permission. Then I realized that I can make a fork to compare to the master branch :)
Hope it is good enough to integrate (still in the learning curve)
Factory Method Pattern in Go is function which returns an interface (something what is implementing an interface)... that's all. This means you should not think about this pattern and use a pattern when you known patterns. You should make only a function like func NewXXX(arguments) <interface> {...} for your needs (or in ideal case package.New()). And every gofer are making this everyday. And it is not a pattern. This is Interface builder or Interface constructor as you like.
I affirm that Go does not require knowledge of any patterns (as OOP requires), but it requires an understanding of SOLID principles and having a mind.
This repository is an example of embedding Litestream as a library in a Go application. The Litestream API is not stable so you may need to update your code in the future when you upgrade.