1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-22 04:56:09 +03:00

README: reformat README for static site generation

This commit is contained in:
Tamer Tas 2016-09-13 14:42:18 +03:00
parent 2ca6861294
commit 5f56da09a2

View File

@ -1,30 +1,30 @@
<p align="center"> <p align="center">
<img src="/gopher.jpg" height="400"> <img src="/gopher.jpg" height="400">
<h1 align="center">
Go Patterns
<br>
<a href="http://travis-ci.org/tmrts/go-patterns"><img alt="Build Status" src="https://img.shields.io/travis/tmrts/go-patterns.svg?style=flat-square" /></a>
<a href="https://github.com/sindresorhus/awesome" ><img alt="Awesome" src="https://img.shields.io/badge/awesome-%E2%9C%93-ff69b4.svg?style=flat-square" /></a>
<a href="https://github.com/tmrts/go-patterns/blob/master/LICENSE" ><img alt="License" src="https://img.shields.io/badge/license-Apache%20License%202.0-E91E63.svg?style=flat-square" /></a>
</h1>
</p> </p>
# Go Patterns [![Travis Widget]][Travis] [![Awesome Widget]][Awesome] [![License Widget]][License]
[Awesome Widget]: https://img.shields.io/badge/awesome-%E2%9C%93-ff69b4.svg?style=flat-square
[Awesome]: https://github.com/sindresorhus/awesome
[Travis Widget]: https://img.shields.io/travis/tmrts/go-patterns.svg?style=flat-square
[Travis]: http://travis-ci.org/tmrts/go-patterns
[License Widget]: https://img.shields.io/badge/license-Creative%20Commons%204.0-E91E63.svg?style=flat-square
[License]: http://creativecommons.org/licenses/by/4.0/
A curated collection of idiomatic design & application patterns for Go language. A curated collection of idiomatic design & application patterns for Go language.
__Creational Patterns__: ## Creational Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Abstract Factory](creational/abstract_factory.md) | Provides an interface for creating families of releated objects | | TODO: [Abstract Factory](creational/abstract_factory.md) | Provides an interface for creating families of releated objects |
| TODO: [Builder](creational/builder.md) | Builds a complex object using simple objects | | TODO: [Builder](creational/builder.md) | Builds a complex object using simple objects |
| TODO: [Factory Method](creational/factory.md) | Defers instantiation of an object to a specialized function for creating instances | | TODO: [Factory Method](creational/factory.md) | Defers instantiation of an object to a specialized function for creating instances |
| [Object Pool](creational/object_pool.md) | Instantiates and maintains a group of objects instances of the same type | | [Object Pool](creational/object_pool.md) | Instantiates and maintains a group of objects instances of the same type |
| [Singleton](creational/singleton.md) | Restricts instantiation of a type to one object | | [Singleton](creational/singleton.md) | Restricts instantiation of a type to one object |
__Structural Patterns__: ## Structural Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Adapter](structural/.md) | Adapts otherwise incompatible interfaces to work together by adapting one to the other | | TODO: [Adapter](structural/.md) | Adapts otherwise incompatible interfaces to work together by adapting one to the other |
| TODO: [Bridge](structural/bridge.md) | Decouples an interface from its implementation so that the two can vary independently | | TODO: [Bridge](structural/bridge.md) | Decouples an interface from its implementation so that the two can vary independently |
| TODO: [Composite](structural/composite.md) | Encapsulates and provides access to a number of different objects | | TODO: [Composite](structural/composite.md) | Encapsulates and provides access to a number of different objects |
@ -34,10 +34,10 @@ __Structural Patterns__:
| TODO: [Model View Controller](structural/model_view_controller.md) | Divides an app into three interconnected parts to separate internal representation from presentation to user | | TODO: [Model View Controller](structural/model_view_controller.md) | Divides an app into three interconnected parts to separate internal representation from presentation to user |
| TODO: [Proxy](structural/proxy.md) | Provides a surrogate for an object to control it's actions | | TODO: [Proxy](structural/proxy.md) | Provides a surrogate for an object to control it's actions |
__Behavioral Patterns__: ## Behavioral Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Chain of Responsibility](behavioral/chain_of_responsibility.md) | Avoids coupling a sender to receiver by giving more than object a chance to handle the request | | TODO: [Chain of Responsibility](behavioral/chain_of_responsibility.md) | Avoids coupling a sender to receiver by giving more than object a chance to handle the request |
| TODO: [Command](behavioral/command.md) | Bundles a command and arguments to call later | | TODO: [Command](behavioral/command.md) | Bundles a command and arguments to call later |
| TODO: [Mediator](behavioral/mediator.md) | Connects objects and acts as a proxy | | TODO: [Mediator](behavioral/mediator.md) | Connects objects and acts as a proxy |
@ -49,20 +49,20 @@ __Behavioral Patterns__:
| TODO: [Template](behavioral/template.md) | Defines a skeleton class which defers some methods to subclasses | | TODO: [Template](behavioral/template.md) | Defines a skeleton class which defers some methods to subclasses |
| TODO: [Visitor](behavioral/visitor.md) | Separates an algorithm from an object on which it operates | | TODO: [Visitor](behavioral/visitor.md) | Separates an algorithm from an object on which it operates |
__Synchronization Patterns__: ## Synchronization Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Condition Variable](synchronization/condition_variable.md) | Provides a mechanism for threads to temporarily give up access in order to wait for some condition | | TODO: [Condition Variable](synchronization/condition_variable.md) | Provides a mechanism for threads to temporarily give up access in order to wait for some condition |
| TODO: [Lock/Mutex](synchronization/mutex.md) | Enforces mutual exclusion limit on a resource to gain exclusive access | | TODO: [Lock/Mutex](synchronization/mutex.md) | Enforces mutual exclusion limit on a resource to gain exclusive access |
| TODO: [Monitor](synchronization/monitor.md) | Combination of mutex and condition variable patterns | | TODO: [Monitor](synchronization/monitor.md) | Combination of mutex and condition variable patterns |
| TODO: [Read-Write Lock](synchronization/read_write_lock.md) | Allows parallel read access, but only exclusive access on write operations to a resource | | TODO: [Read-Write Lock](synchronization/read_write_lock.md) | Allows parallel read access, but only exclusive access on write operations to a resource |
| [Semaphore](synchronization/semaphore.md) | Allows controlling access to a common resource | | [Semaphore](synchronization/semaphore.md) | Allows controlling access to a common resource |
__Concurrency Patterns__: ## Concurrency Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [N-Barrier](concurrency/barrier.md) | Prevents a process from proceeding until all N processes reach to the barrier | | TODO: [N-Barrier](concurrency/barrier.md) | Prevents a process from proceeding until all N processes reach to the barrier |
| [Bounded Parallelism](concurrency/bounded_parallelism.md) | Completes large number of independent tasks with resource limits | | [Bounded Parallelism](concurrency/bounded_parallelism.md) | Completes large number of independent tasks with resource limits |
| TODO: [Broadcast](concurrency/broadcast.md) | Transfers a message to all recipients simultaneously | | TODO: [Broadcast](concurrency/broadcast.md) | Transfers a message to all recipients simultaneously |
@ -73,20 +73,20 @@ __Concurrency Patterns__:
| TODO: [Producer Consumer](concurrency/producer_consumer.md) | Separates tasks from task executions | | TODO: [Producer Consumer](concurrency/producer_consumer.md) | Separates tasks from task executions |
| TODO: [Scheduler](concurrency/scheduler.md) | Orchestrates steps to be performed as part of a task | | TODO: [Scheduler](concurrency/scheduler.md) | Orchestrates steps to be performed as part of a task |
__Messaging Patterns__: ## Messaging Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| [Fan-In](messaging/fan_in.md) | Funnels tasks to a work sink (e.g. server) | | [Fan-In](messaging/fan_in.md) | Funnels tasks to a work sink (e.g. server) |
| [Fan-Out](messaging/fan_out.md) | Distributes tasks among workers (e.g. producer) | | [Fan-Out](messaging/fan_out.md) | Distributes tasks among workers (e.g. producer) |
| TODO: [Futures & Promises](messaging/futures_promises.md) | Acts as a place-holder of a result that is initially unknown for synchronization purposes | | TODO: [Futures & Promises](messaging/futures_promises.md) | Acts as a place-holder of a result that is initially unknown for synchronization purposes |
| [Publish/Subscribe](messaging/publish_subscribe.md) | Passes information to a collection of recipients who subscribed to a topic | | [Publish/Subscribe](messaging/publish_subscribe.md) | Passes information to a collection of recipients who subscribed to a topic |
| TODO: [Push & Pull](messaging/push_pull.md) | Distributes messages to multiple workers, arranged in a pipeline | | TODO: [Push & Pull](messaging/push_pull.md) | Distributes messages to multiple workers, arranged in a pipeline |
__Stability Patterns__: ## Stability Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Bulkheads](stability/bulkhead.md) | Enforces a principle of failure containment (i.e. prevents cascading failures) | | TODO: [Bulkheads](stability/bulkhead.md) | Enforces a principle of failure containment (i.e. prevents cascading failures) |
| [Circuit-Breaker](stability/circuit_breaker.md) | Stops the flow of the requests when requests are likely to fail | | [Circuit-Breaker](stability/circuit_breaker.md) | Stops the flow of the requests when requests are likely to fail |
| TODO: [Deadline](stability/deadline.md) | Allows clients to stop waiting for a response once the probability of response becomes low (e.g. after waiting 10 seconds for a page refresh)| | TODO: [Deadline](stability/deadline.md) | Allows clients to stop waiting for a response once the probability of response becomes low (e.g. after waiting 10 seconds for a page refresh)|
@ -94,31 +94,25 @@ __Stability Patterns__:
| TODO: [Handshaking](stability/handshaking.md) | Asks a component if it can take any more load, if it can't the request is declined | | TODO: [Handshaking](stability/handshaking.md) | Asks a component if it can take any more load, if it can't the request is declined |
| TODO: [Steady-State](stability/steady_state.md) | For every service that accumulates a resource, some other service must recycle that resource | | TODO: [Steady-State](stability/steady_state.md) | For every service that accumulates a resource, some other service must recycle that resource |
__Profiling Patterns__: ## Profiling Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Timing Functions](profiling/timing.md) | Wraps a function and logs the execution | | TODO: [Timing Functions](profiling/timing.md) | Wraps a function and logs the execution |
__Idioms__: ## Idioms
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| [Functional Options](idiom/functional-options.md) | Allows creating clean APIs with sane defaults and idiomatic overrides | | [Functional Options](idiom/functional-options.md) | Allows creating clean APIs with sane defaults and idiomatic overrides |
__Anti-Patterns__: ## Anti-Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
| TODO: [Cascading Failures](antipatterns/cascading_failures.md) | A failure in a system of interconnected parts in which the failure of a part causes a domino effect | | TODO: [Cascading Failures](antipatterns/cascading_failures.md) | A failure in a system of interconnected parts in which the failure of a part causes a domino effect |
__Other Patterns__: ## Other Patterns
| Pattern | Description | | Pattern | Description |
|:-------:| ----------- | |:-------:| :---------- |
# License
[![Creative Commons License](http://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/)
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).