• Stars
    star
    304
  • Rank 137,274 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ultra-simple RPC ecosystem designed for right now.

Remoto banner

Remoto

Ultra-simple, fast, complete RPC ecosystem designed for right now.

  • Simple service definitions written in Go (interfaces and structs)
  • Generates servers and clients that makes implementing/consuming easy
  • Generates human-readable code
  • Supports batch requests out of the box
  • Lots of templates to use today
  • Modify templates or write your own

In this document

Introduction

Remoto is an RPC ecosystem and code generation tool. A powerful set of templates and supporting code allows you to quickly spin up RPC services, and consume them with hand crafted client libraries by experts in each particular language.

Who is Remoto for?

Remoto is for teams who want to:

  • Deliver mobile and web RPC services
  • Automate SDK and client library generation
  • Stick with simple and familiar technology

Remoto definition files

Definition files are Go source with .remoto.go file extension.

An example definition looks like this:

package project

// Greeter provides greeting services.
type Greeter interface {
	// Greet generates a greeting.
	Greet(GreetRequest) GreetResponse
}

// GreetRequest is the request for Greeter.GreetRequest.
type GreetRequest struct {
	Name string
}

// GreetResponse is the response for Greeter.GreetRequest.
type GreetResponse struct {
	Greeting string
}
  • package project - package name can group services
  • type ServiceName interface - describes an RPC service
  • Greet(GreetRequest) GreetResponse - service method with request and response objects
  • type GreetRequest struct - describes the request data
  • type GreetResponse struct - describes the response data

Rules

  • Each service is an interface
  • Each method is an endpoint
  • Methods must take a request object as its only argument
  • Methods must return the response object as the result
  • Only a subset of Go types are supported: string, float64, int, bool, and struct types
  • Any arrays (slices) of the supported types are also allowed (e.g. []string, []bool, etc.)
  • Comments describe the services, methods and types
  • Do not import packages (apart from official Remoto ones), instead your definition files should be self contained

Special types

  • Learn more about specially handled types in remototypes.

Tips

  • Avoid importing common types - describe all the required types in a single .remoto.go file

Remoto command

The remoto command can be built into your development pipeline to generate source code from definition files.

usage:
	remoto sub-command

Generate

The generate command generates source code from a given template.

usage:
	remoto generate definition template -o output-file
  • definition - Path to the definition file
  • template - Path to the template to render
  • output-file - Where to save the output (folders will be created and files will be overwritten without warning)

remotohttp

As well as code generation, Remoto ships with a complete HTTP client/server implementation which you can generate from your definition files.

For more information, see the remotohttp documentation.

More Repositories

1

graphql

Simple low-level GraphQL HTTP client for Go
Go
933
star
2

appify

Create a macOS Application from an executable (like a Go binary)
Go
512
star
3

progress

io.Reader and io.Writer with progress and remaining time estimation
Go
409
star
4

toys

Tools, scripts, toys, and utilities for Machine Box
Go
241
star
5

sdk-go

Official Go SDK for Machine Box
Go
144
star
6

desktop

Go/HTML/CSS/JS Desktop application scaffold.
Go
130
star
7

webFaceID

Use HTML5, Go and Facebox to implement face verification on a website
Go
59
star
8

webcamFacebox

Streaming from a webcam to facebox to do face recognition
Go
39
star
9

twitterfeed

Go channel providing live tweets containing search terms.
Go
35
star
10

videoanalysis

Webapp to process Video and do Face Recognition with Facebox
Go
32
star
11

visualsearch

Visual Search is a little app to find and cluster similar images using Tagbox
Go
31
star
12

mood

Twitter analytics using textbox
Go
14
star
13

textbox_elastic_indexer

Example how to pre-process news articles with textbox and index on Elastic Search
Go
13
star
14

machinebox-python-sdk

Python SDK for Machine Box services
Python
9
star
15

nevernude

Tool for stripping nudity from a video - Powered by Videobox + Nudebox
8
star
16

gopherconeu

Gophercon EU Machine Learning Workshop
Go
6
star
17

faceboxtools

Tools in Go for facebox, so you can quickly teach and tag based on folders
Go
4
star
18

issues

Machine Box issues, bugs and feature requests
2
star
19

ops

Operations
Makefile
2
star
20

womenwhogo

Women Who Go: workshop
Go
2
star
21

tagboxtools

Tools to tag and check images in your filesystem with tagbox
Go
1
star