Code Monkey home page Code Monkey logo

nakama-common's Introduction

nakama-common

The runtime framework for Nakama server.

This codebase defines the runtime API and protocol interface used by Nakama.

The code is broken up into packages for different parts of the runtime framework:

  • api - The request/response messages used with GRPC and in some of the realtime API.
  • rtapi - The realtime messages sent and received over a socket connection.
  • runtime - The Go types and functional interface used by Nakama plugins to execute native logic. See the Nakama server documentation for more info.

Contribute

The codebase uses Protocol Buffers. The protoc toolchain is used to generate source files which are committed to the repository to simplify builds for contributors.

To build the codebase and generate all sources use these steps.

  1. Install the Go toolchain and protoc toolchain.

  2. Intall the protoc-gen-go plugin to generate Go code.

    go install "google.golang.org/protobuf/cmd/protoc-gen-go"
  3. Use the Go generate command to generate all Go stubs.

    env PATH="$HOME/go/bin:$PATH" go generate -x ./...

These steps have been tested with the Go 1.14 toolchain. Earlier Go toolchain versions may work though YMMV.

Using this Go package

To use the Go language with your Nakama server project you compile your code as a shared object. Use these basic steps to set up the Go project and consult the documentation for more information.

  1. Install the Go toolchain.

    NOTE: You must use the exact same version of the Go toolchain as the specific release the server was built with. Run the server with "--logger.level DEBUG" to see the version of the Go runtime used.

  2. Create a Go project.

    go mod init "myproject/server"
  3. Add this package as a dependency to the project and vendor it.

    go get -u "github.com/heroiclabs/nakama-common/runtime"
    go mod vendor
  4. Write your Go code and compile it as a Go plugin

    go build -buildmode=plugin -trimpath

Release Process

Make sure that the package.json version is in tandem with the go package releases.

License

This project is licensed under the Apache-2 License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.