# README
Protos-common
The Kitt common proto library
Adding a new common message
- Add the message to
./common.proto
- If you want some custom logic:
- Add the message option:
option (graphql.skip_message) = true;
- Create a file for your custom logic:
./common/<message_name>.graphql.go
- To work with the generation library it needs to implement 3 things:
func <Message_name>FromArgs(field map[string]interface{}) *<Message_name> {} var <Message_name>GraphqlInputType gql.InputObject{} var <Message_name>GraphqlType gql.Object{}
- See
./common/money.graphql.go
for an example
- Run
make generate
- Commit, merge, and pull
- Tag the new version:
git tag v0.X.X
- Push the tag:
git push --tags
- Update
KITT_REPO/build/common/docker/deps/Dockerfile
:ENV PROTOS_COMMON_VERSION v0.X.X
- Rebuild the docker image:
docker build --build-arg GITHUB_TOKEN -t gcr.io/kitt-220208/deps .
- Push that docker image (optional):
docker push gcr.io/kitt-220208/deps
- Import the common package in a proto:
import "github.com/kitt-technology/protos-common/common.proto";
- Use the common object:
common.Money price = 1;
Useful Resources
Google's proto library: https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
# Packages
No description provided by the author