vmware / Hamlet
Programming Languages
Hamlet
Hamlet specifies a set of API standards for enabling service mesh federation. The API specification was realized as a collaborative effort with service mesh vendors viz. Google, HashiCorp, Pivotal and VMware.
The specification currently consists of the following APIs.
- Federated Resource Discovery API - API to authenticate and securely distribute resources between federated service meshes.
- Federated Service Discovery API - API to discover, reach, authenticate, and securely communicate with federated services.
Extending
Please see EXTENDING.md if you'd like to extend this project's core to implement functionality for an owning or consuming federated service mesh. You can find concrete extension samples in the examples directory.
Building
To compile a Protobuf file into Go, you can use the following command.
$ protoc -I api/types/v1alpha2/ federated_service.proto --go_out=api/
To download the external dependencies, use the following commands.
$ mkdir -p external/google/rpc/
$ curl -L -o external/google/rpc/status.proto https://github.com/grpc/grpc/raw/master/src/proto/grpc/status/status.proto
To compile a Protobuf into Go along with the necessary gRPC server and client stubs, you can use the following command.
$ protoc -I external/ -I api/resourcediscovery/v1alpha1/ resource_discovery.proto --go_out=plugins=grpc:api/
Testing
The project relies on the mockgen tool for generating gRPC mocks for unit tests. Please make sure that you have it installed before proceeding.
1. Generate mocks.
$ go generate ./...
2. Run tests using Ginkgo or go test
.
$ ginkgo -v ./...
OR
$ go test -v ./...
Contributing
Please see CONTRIBUTING.md if you'd like to contribute.
License
Hamlet is licensed under the Apache License, Version 2.0. See the LICENSE file for the full license text.