-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Generate services | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
GPT_API: https://api.github.com | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
hello-service: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.19.3' # Important to have the minor | ||
- name: generate_prompt | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/osangenis/pap/v2 | ||
|
||
go 1.20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
in: hello {{ .data.thing }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Hello World API service | ||
* | ||
* Just an experimenting API that will ping what you send | ||
*/ | ||
syntax = "proto3"; | ||
|
||
package hello; | ||
|
||
option go_package = "github.com/osangenis/hello"; | ||
|
||
|
||
// Hello Service | ||
service HelloService { | ||
// Returns the same string that was sent | ||
rpc Ping(string) returns (string); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
As a senior golang engineer, write a gRPC API service that implements the service described in the file `hello.proto` that has the following content: | ||
|
||
``` /** | ||
* Hello World API service | ||
* | ||
* Just an experimenting API that will ping what you send | ||
*/ | ||
syntax = "proto3"; | ||
|
||
package hello; | ||
|
||
option go_package = "github.com/osangenis/hello"; | ||
|
||
|
||
// Hello Service | ||
service HelloService { | ||
// Returns the same string that was sent | ||
rpc Ping(string) returns (string); | ||
} | ||
``` | ||
|
||
The service must be implemented in the file `hello.go`. | ||
The service must be able to be run with the command `go run hello.go`. | ||
The service should listen on port 8080 if the environment variable `PORT` is not defined. Otherwise should run in the port defined by the environment variable `PORT` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
As a senior golang engineer, write a gRPC API service that implements the service described in the file `hello.proto` that has the following content: | ||
|
||
``` {{ template "./hello/hello.proto" }} ``` | ||
|
||
The service must be implemented in the file `hello.go`. | ||
The service must be able to be run with the command `go run hello.go`. | ||
The service should listen on port 8080 if the environment variable `PORT` is not defined. Otherwise should run in the port defined by the environment variable `PORT` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
GO_GENERATOR_BIN_URL=https://github.com/StephanHCB/go-generator-cli/releases/download/v1.3.2/go-generator-cli_1.3.2_Darwin_x86_64 | ||
GO_GENERATOR_BIN=./bin/go-generator-cli | ||
|
||
install-gomplate-macos: | ||
brew install gomplate | ||
|
||
install-templating-macos: | ||
mkdir -p bin | ||
brew install wget | ||
wget ${GO_GENERATOR_BIN_URL} -O ${GO_GENERATOR_BIN} | ||
chmod +x ${GO_GENERATOR_BIN} | ||
|
||
hello-service: | ||
# ${GO_GENERATOR_BIN} --generator=./hello --target=./hello --render | ||
gomplate -f ./hello/prompt.tmpl -o ./hello/prompt.gpt --template ./hello/hello.proto |