Ship is a go library for building efficient event driven applications. It provides protoc plugin library for efficient proto-based event generation.
- Easy to understand
- Fast
- Resilient
To mark any message inside a proto file as an event.
- Import the
schema/ship.protoinside the proto file. - Add the
option (ship.event) = true;inside the message definition.
Example:
syntax = "proto3";
package example.v1;
option go_package = "v1/example";
import "schema/ship.proto";
message SomethingCreated {
// marking a message as an event will generate the required the files for it.
option (ship.event) = true;
string id = 1;
string name = 2;
string created_at = 3;
}Install protoc-gen-ship from the following command
go install github.com/Flahmingo-Investments/ship/protoc-gen-ship@latestGet the schema/ship.proto file
To compile.
protoc \
-I . \
--ship_out="some/path/" \
path/to/proto/file
You can see the examples in example folder.
To build the example files, run the following commands
make example