Categorygithub.com/egoodhall/servo
repository
0.0.0-20240711035000-b57a2b45f661
Repository: https://github.com/egoodhall/servo.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

servo

A toy DSL and framework for cross-language API generation

Servo DSL

Options

Plugin options can be specified for configuring code generation.

option gojson.package = "package";

Message

Messages have fields with specified types

message AllTypes {
  // message fields
  message_field: OtherType;
  // 32-bit integers
  int_field: int32;
  // 64-bit integers
  long_field: int64;
  // 32-bit floating points
  float_field: float32;
  // 64-bit floating points
  double_field: float64;
  // maps (key must be primitive)
  map_field: map[string]int;
  // lists
  list_field: list[string];
}

RPC Service

Services can define RPCs that send and receive messages.

message EchoRequest {
  message: string;
}

message EchoResponse {
  message: string;
}

// Echo a message
service EchoService {
  rpc echo(EchoRequest): EchoResponse;
}

PubSub Service

Services can define Publish methods that send messages without responses.

message StatusUpdate {
  message: string;
}

service StatusService {
  pub update(StatusUpdate);
}