This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Quick Start

Quickly start the service development with Goten framework.

Prerequisites

  • Git distributed version control software.

    For instration instructions, see Git’s Installation guide.

  • clang-format code formatter.

    Grab the clang-format through the OS package manager and rename it to clang-format-12 as blow:

    $ ln -s $(which clang-format) $(dirname $(which clang-format))/clang-format-12
    

Get the example code

The example code is part of the goten repo.

  1. Close the repo:

    $ git clone https://github.com/cloudwan/goten
    
  1. Change to the top directory and install Protocol buffer compiler, protoc, version 3, Go plug-ins for the protocol compiler, and JavaScript packages with install-proto-deps.sh script:

    $ cd goten
    $ ./scripts/install-proto-deps.sh
    
  1. Change to the quick start example directory:

    $ cd example/helloworld
    

Run the example

From the example/helloworld directory:

  1. Compile and execute the server code:

    $ go run cmd/greeter_server/main.go
    
  2. From a different terminal, compile and execute the client code to see the client output:

    $ go run cmd/greeter_client/main.go -name Goten
    Greeting: Hello Goten
    

Congratulations! You’ve just run a client-server application with Goten.

What’s Next