Protobuffers

You could use your existing protobuffers as schema definition. Services could be configured and exposed through annotations provided inside the Maestro repository.

Introduction

You could use your existing protobuffers and extend them with Semaphore annotations. Include the Maestro annotations inside your project to get started.

The Semaphore proto annotations are available inside the git repo. You could simple clone the repo and include the annotations inside your project.

If you do not want to store certain options inside your protobuffers. The options could be overridden through service selectors.

package proto;

import "maestro/annotations.proto";

service Users {
    option (maestro.service) = {
        host: "https://service.users/"
        protocol: "http"
        codec: "json"
    };

    rpc Get(Query) returns (User) {
        option (maestro.http) = {
            endpoint: "/user/:id"
            method: "GET"
        };
    };
}

Properties within the request object could be referenced inside the endpoint

Services and messages should be referenced inside a flow with their fully qualified name (package name + service/message).

flow "user" {
	input "proto.Query" {}

	resource "user" {
		request "proto.Users" "Get" {
			id = "{{ input:id }}"
		}
	}
}

Last updated