gitee.com/sasukebo/go-micro/v4@v4.7.1/README.md (about)

     1  # Go Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/gitee.com/sasukebo/go-micro/v4?tab=doc) [![Community](https://img.shields.io/:community-projects-orange.svg)](https://github.com/go-micro)
     2  
     3  
     4  Go Micro is a framework for distributed systems development.
     5  
     6  ## Overview
     7  
     8  Go Micro provides the core requirements for distributed systems development including RPC and Event driven communication.
     9  The Go Micro philosophy is sane defaults with a pluggable architecture. We provide defaults to get you started quickly
    10  but everything can be easily swapped out.
    11  
    12  ## Features
    13  
    14  Go Micro abstracts away the details of distributed systems. Here are the main features.
    15  
    16  - **Authentication** - Auth is built in as a first class citizen. Authentication and authorization enable secure
    17    zero trust networking by providing every service an identity and certificates. This additionally includes rule
    18    based access control.
    19  
    20  - **Dynamic Config** - Load and hot reload dynamic config from anywhere. The config interface provides a way to load application
    21    level config from any source such as env vars, file, etcd. You can merge the sources and even define fallbacks.
    22  
    23  - **Data Storage** - A simple data store interface to read, write and delete records. It includes support for memory, file and
    24    CockroachDB by default. State and persistence becomes a core requirement beyond prototyping and Micro looks to build that into the framework.
    25  
    26  - **Service Discovery** - Automatic service registration and name resolution. Service discovery is at the core of micro service
    27    development. When service A needs to speak to service B it needs the location of that service. The default discovery mechanism is
    28    multicast DNS (mdns), a zeroconf system.
    29  
    30  - **Load Balancing** - Client side load balancing built on service discovery. Once we have the addresses of any number of instances
    31    of a service we now need a way to decide which node to route to. We use random hashed load balancing to provide even distribution
    32    across the services and retry a different node if there's a problem.
    33  
    34  - **Message Encoding** - Dynamic message encoding based on content-type. The client and server will use codecs along with content-type
    35    to seamlessly encode and decode Go types for you. Any variety of messages could be encoded and sent from different clients. The client
    36    and server handle this by default. This includes protobuf and json by default.
    37  
    38  - **RPC Client/Server** - RPC based request/response with support for bidirectional streaming. We provide an abstraction for synchronous
    39    communication. A request made to a service will be automatically resolved, load balanced, dialled and streamed.
    40  
    41  - **Async Messaging** - PubSub is built in as a first class citizen for asynchronous communication and event driven architectures.
    42    Event notifications are a core pattern in micro service development. The default messaging system is a HTTP event message broker.
    43  
    44  - **Event Streaming** - PubSub is great for async notifications but for more advanced use cases event streaming is preferred. Offering
    45    persistent storage, consuming from offsets and acking. Go Micro includes support for NATS Jetstream and Redis streams.
    46  
    47  - **Synchronization** - Distributed systems are often built in an eventually consistent manner. Support for distributed locking and
    48    leadership are built in as a Sync interface. When using an eventually consistent database or scheduling use the Sync interface.
    49  
    50  - **Pluggable Interfaces** - Go Micro makes use of Go interfaces for each distributed system abstraction. Because of this these interfaces
    51    are pluggable and allows Go Micro to be runtime agnostic. You can plugin any underlying technology.
    52  
    53  ## Getting Started
    54  
    55  To make use of Go Micro
    56  
    57  ```golang
    58  import "gitee.com/sasukebo/go-micro/v4"
    59  
    60  // create a new service
    61  service := micro.NewService(
    62      micro.Name("helloworld"),
    63  )
    64  
    65  // initialise flags
    66  service.Init()
    67  
    68  // start the service
    69  service.Run()
    70  ```
    71  
    72  See the [examples](https://github.com/go-micro/examples) for detailed information on usage.
    73  
    74  ## Code Generation
    75  
    76  See [cmd/protoc-gen-micro](https://github.com/micro/go-micro/tree/master/cmd/protoc-gen-micro) for protobuf code generation.
    77  
    78  ## Community
    79  
    80  See [github.com/go-micro](https://github.com/go-micro) for community led projects.
    81  
    82  - [Plugins](https://github.com/go-micro/plugins)
    83  - [Examples](https://github.com/go-micro/examples)
    84  - [Dashboard](https://github.com/go-micro/dashboard)
    85  - [CLI](https://github.com/go-micro/cli)
    86  
    87  ## Changelog
    88  
    89  See [CHANGELOG.md](https://github.com/micro/go-micro/tree/master/CHANGELOG.md) for release history.
    90  
    91  ## Evolution
    92  
    93  Go Micro started in 2015. It's since evolved into a platform called [Micro](https://micro.dev) and a service called [M3O](https://m3o.com).
    94  
    95  ## License
    96  
    97  Go Micro is Apache 2.0 licensed.