🚀
Semaphore
  • Introduction
  • Getting started
    • Go API
    • CLI
    • Docker
    • Examples
  • Cookbook
    • Flows
      • References
      • Error handling
      • Conditional logic
      • Proxy forward
    • Schemas
      • Protobuffers
    • Transport
      • HTTP
      • Go micro
      • GraphQL
    • DevOps
  • Contributing
Powered by GitBook
On this page
  1. Cookbook
  2. Schemas

Protobuffers

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

PreviousSchemasNextTransport

Last updated 4 years ago

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 . 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 .

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 }}"
		}
	}
}

git repo
service selectors