From 25c473d8e08bd32c6d20574a79788268b1ba60f2 Mon Sep 17 00:00:00 2001 From: Tamer Tas Date: Tue, 19 Jan 2016 08:49:13 +0200 Subject: [PATCH] Update README --- README.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f848885..806667b 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,24 @@ # 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/awesome-google-cloud.svg?style=flat-square +[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. +For use cases please see the test files (files suffixed with _test). + __Creational Patterns__: | Pattern | Description | |:-------:| ----------- | | [Abstract Factory](abstract_factory.go) | use a generic function with specific factories | -| [Borg Singleton](borg_singleton.go) | a singleton with shared-state among instances | -| [Builder](builder.go) | instead of using multiple constructors, builder object receives parameters and returns constructed objects | +| [Singleton](singleton/singleton.go) | Restricts instantiation of a class to one object | +| [Builder](builder/builder.go) | instead of using multiple constructors, builder object receives parameters and returns constructed objects | | [Factory Method](factory_method.go) | delegate a specialized function/method to create instances | | [Lazy Evaluation](lazy_evaluation.go) | lazily-evaluated property pattern in Go | -| [Object Pool](object_pool.go) | preinstantiate and maintain a group of instances of the same type | -| [Prototype](prototype.go) | use a factory and clones of a prototype for new instances (if instantiation is expensive) | +| [Object Pool](object_pool/pool.go) | Instantiates and maintains a group of objects instances of the same type | __Structural Patterns__: @@ -47,11 +48,10 @@ __Behavioral Patterns__: | [Mediator](mediator.go) | an object that knows how to connect other objects and act as a proxy | | [Memento](memento.go) | generate an opaque token that can be used to go back to a previous state | | [Observer](observer.go) | provide a callback for notification of events/changes to data | -| [Publish/Subscribe](publish_subscribe.go) | Passes information to a collection of recipients who subscribed to a topic | | [Registry](registry.go) | keep track of all subclasses of a given class | | [Specification](specification.go) | business rules can be recombined by chaining the business rules together using boolean logic | | [State](state.go) | logic is organized into a discrete number of potential states and the next state that can be transitioned to | -| [Strategy](strategy.go) | Encapsulates an algorithm inside a struct | +| [Strategy](strategy/strategy.go) | Encapsulates an algorithm inside a struct | | [Template](template.go) | an object imposes a structure but takes pluggable components | | [Visitor](visitor.go) | invoke a callback for all items of a collection | @@ -59,11 +59,11 @@ __Synchronization Patterns__: | Pattern | Description | |:-------:| ----------- | -| [Lock/Mutex](mutex.go) | Enforces mutual exclusion limit on accessing a resource | +| [Lock/Mutex](mutex/mutex.go) | Enforces mutual exclusion limit on accessing a resource | | [Read-Write Lock](read_write_lock.go) | | | [Condition Variable](condition_variable.go) | | -| [Monitor](monitor.go) | Combination of mutex and condition patterns | -| [Semaphore](semaphore.go) | Allows controlling access to a common resource | +| [Monitor](monitor.go) | Combination of mutex and condition variable patterns | +| [Semaphore](semaphore/semaphore.go) | Allows controlling access to a common resource | __Concurrency Patterns__: @@ -75,16 +75,25 @@ __Concurrency Patterns__: | [Futures](future.go) | | | [Broadcast](broadcast.go) | | | [Multiplex](multiplex.go) | | -| [Fan-In](fan_in.go) | | | [Generators](generator.go) | | -| [Coroutines](coroutine.go) | | +| [Coroutines](coroutine/coroutine.go) | | +| [Parallelism](parallelism/md5.go) | Completes large number of indenpendent tasks | +| [Bounded Parallelism](bounded_parallelism/md5.go) | Completes large number of indenpendent tasks with resource limits | + +__Messaging Patterns__: +| [Fan-In](fan/fan_in.go) | Funnels tasks to a work sink (e.g. server) | +| [Fan-Out](fan/fan_out.go) | Distributes tasks amongs workers | +| [Publish/Subscribe](publish_subscribe.go) | Passes information to a collection of recipients who subscribed to a topic | +| [Request & Reply](fan) | | +| [Push & Pull](fan) | | + __Stability Patterns__: | Pattern | Description | |:-------:| ----------- | | [Bulkheads](bulkhead.go) | | -| [Circuit Breaker](circuit_breaker.go) | | +| [Circuit Breaker](circuitbreaker/circuit_breaker.go) | Stops the flow of the requests when requests are likely to fail | | [Deadline](deadline.go) | | | [Fail Fast](fail_fast.go) | | | [Handshaking](handshaking.go) | | @@ -106,6 +115,7 @@ __Anti-Patterns__: | Pattern | Description | |:-------:| ----------- | +| [Cascading Failures]() | | __Other Patterns__: