Home

Awesome

Orbit - Interlink Services

GoDoc coverage license

Orbit provides a powerful, MIT-licensed networking backend to interlink services. It offers RPC like features and is primarily stateless. It aims to be light-weight and customizable.

LOGO

Current Status

This project is under heavy development. The API may change at any time.

Table of Contents

  1. Features
  2. Orbit File Syntax
    1. Service
      1. Call
      2. Stream
    2. Type
      1. Basic Type
      2. Reference Type
      3. Inline Type
    3. Enum
    4. Error
  3. Similar Projects

Features

Orbit File Syntax

This section describes the syntax of .orbit files used for code generation.

Service

Per .orbit file, you must declare exactly one service.

service {
    url: "example.com:4848"
    call sayHi { ... }
    stream messages { ... }
}

Call

Per service, you can declare as many calls as you want.

service {
    call sayHi {
        async
        timeout: 5s
        arg: {
            name string 'required,min=1'
        }
        maxArgSize: 50KB
        ret: someType
        maxRetSize: 10MiB
    }
}

Stream

Per service, you can declare as many streams as you want.

service {
    stream messages {
        timeout: 5s
        arg: {
            name string 'required,min=1'
        }
        ret: someType
    }
}

Type

Per .orbit file, you can declare as many types as you want.

type someType {
    name string 'required,min=1'
    ...
}

Each field of a type must have the following syntax: <identifier> <datatype> '<validation>'

Basic Type

The following basic types are available.

Reference Type

A type that has been declared using the above syntax can be referenced elsewhere by its identifier

type A {
    someField int
}

type B {
    a A
}

service {
    call test {
        arg: B
    }
}

Inline Type

Calls and Streams may define types inline. Such types receive a generated identifier of the form <Call/Stream Name><Arg/Ret>, but they can not be referenced elsewhere.

service {
    call test {
        arg: {
            name string 'required'
        }
        ret: {
            age int
        }
    }
}

Enum

Per .orbit file, you can declare as many enums as you want.

enum carBrand {
    bmw = 1
    audi = 2
    volvo = 3
    toyota = 4
    vw = 5
}

Each field of an enum must have the following syntax: <name> = <identifier>

An enum can be used similar to basic types.

type A {
    brand carBrand 'required'
}

service {
    call getBrand {
        ret: {
            carBrand
        }
    }
}

Error

Per .orbit file, you can declare as many errors as you want.

errors {
    myFirstError = 1
    anotherOne = 2
}

Each field of an errors block must have the following syntax: <name> = <number>

Similar projects

Thanks to