github.com/micro/go-micro/examples@v0.0.0-20210105173217-bf4ab679e18b/server/README.md (about)

     1  # Service
     2  
     3  An example Go service running with go-micro
     4  
     5  ## Contents
     6  
     7  - main.go - initialises and runs the the server
     8  - handler - is an example RPC request handler for the Server
     9  - proto - contains the protobuf defintion for the Server API
    10  - subscriber - is a handler for subscribing via the Server
    11  - wrapper - demonstrates use of a server HandlerWrapper
    12  - codegen - shows how to use codegenerated registration to reduce boilerplate
    13  
    14  ## Usage
    15  
    16  Run Service
    17  ```
    18  $ go run server/main.go
    19  I0525 18:06:14.471489   83304 server.go:117] Starting server go.micro.srv.example id go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6
    20  I0525 18:06:14.474960   83304 rpc_server.go:126] Listening on [::]:62216
    21  I0525 18:06:14.474997   83304 server.go:99] Registering node: go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6
    22  ```
    23  
    24  Test Service
    25  ```
    26  $ go run client/main.go 
    27  go.micro.srv.example-59b6e0ab-0300-11e5-b696-68a86d0d36b6: Hello John
    28  ```