Skip to content

Commit

Permalink
V2 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavovojacek authored May 26, 2024
1 parent f792fb2 commit 79db074
Show file tree
Hide file tree
Showing 63 changed files with 637 additions and 7,493 deletions.
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Community Code of Conduct

Thames Technology follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: thames
Binary file added .github/assets/apigen-cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
gofmt:
name: Go Format
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run gofmt
run: gofmt -l -s .

golangci-lint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58

test:
name: Go Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run tests
run: go test ./... -v
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target

4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright © 2022 Slavo Vojacek <public@slavovojacek.com>
Copyright (c) 2024 Thames Technology <slavo@thames.technology>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 16 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
# cloudstd
<p align="center">
<img src="https://raw.githubusercontent.com/thames-technology/apigen/main/.github/assets/apigen-cover.png" alt="API Gen Logo" />
</p>

Generate Protobuf service definitions conforming to popular design guides:
<p align="right">
<i>If you use this repo, star it ✨</i>
</p>

- [Buf Style Guide](https://docs.buf.build/best-practices/style-guide)
- [Uber Protobuf Style Guide V2](https://github.com/uber/prototool/blob/dev/style/README.md)
- [Google Cloud API Design Guide](https://cloud.google.com/apis/design)
---

## Installation
<h2 align="center">Generate best-practice Protobuf APIs following design patterns</h2>

```sh
go install github.com/slavovojacek/cloudstd@latest
```

## Usage
<p align="center">
Inspired by <a href="https://www.oreilly.com/library/view/api-design-patterns/9781617295850/" target="_blank">API Design Patterns</a>
</p>

### Modern, simple style
---

This style is based on [Buf Style Guide](https://docs.buf.build/best-practices/style-guide) and [Uber Protobuf Style Guide V2](https://github.com/uber/prototool/blob/dev/style/README.md).
## Install

```sh
proto> cloudstd proto --package "acme.shelf.v1" --resource "shelf,shelves"
proto> cloudstd proto --package "acme.book.v1" --resource "book" --parent "shelf,shelves"
# TODO
```

The generated code can be found [in the docs](docs/examples/proto/modern/README.md).

### Google style

This style is based on the [Google Cloud API Design Guide](https://cloud.google.com/apis/design).
## Getting started

```sh
proto> cloudstd proto --package "acme.shelf.v1" --resource "shelf,shelves" --google
proto> cloudstd proto --package "acme.book.v1" --resource "book" --parent "shelf,shelves" --google
apigen proto -r book -pkg bookservice.v1alpha1
```

The generated code can be found [in the docs](docs/examples/proto/google/README.md).
83 changes: 0 additions & 83 deletions cmd/proto.go

This file was deleted.

91 changes: 0 additions & 91 deletions cmd/root.go

This file was deleted.

31 changes: 0 additions & 31 deletions docs/examples/proto/google/README.md

This file was deleted.

Loading

0 comments on commit 79db074

Please sign in to comment.