-
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.
feat(byo-vpc-tutorial): add separate byo-vpc directory (#38)
- Loading branch information
1 parent
676baaa
commit 9f7c731
Showing
40 changed files
with
943 additions
and
33 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
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
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
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
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,5 @@ | ||
# Create a BYO-VPC App | ||
|
||
This project contains sample code for our [Create a BYO-VPC App](https://docs.nuon.co/tutorials/byo-vpc-tutorial) guide on our [docs site](https://docs.nuon.co/). | ||
|
||
The [./terraform-app-config](./terraform-app-config) directory contains a sample Terraform project for creating a BYO-VPC app. The [./components](./components) directory contains the components the app consists of. |
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,10 @@ | ||
FROM golang:1.21.1 | ||
|
||
WORKDIR /app | ||
COPY ./ ./ | ||
RUN go mod download | ||
COPY *.go ./ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o /api | ||
|
||
EXPOSE 8080 | ||
CMD ["/api"] |
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,44 @@ | ||
package main | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
"github.com/nuonco/guides/byo-vpc-tutorial/components/docker-image/internal/introspection" | ||
) | ||
|
||
type discoverEndpoint struct { | ||
Path string `json:"path"` | ||
Description string `json:"description"` | ||
} | ||
|
||
type discoverResponse struct { | ||
Description string `json:"description"` | ||
Endpoints []discoverEndpoint `json:"endpoints"` | ||
} | ||
|
||
func discoverHandler(ctx *gin.Context) { | ||
resp := &discoverResponse{ | ||
Description: "This api exposes introspection details of a Nuon app running in a customer's cloud account.", | ||
Endpoints: []discoverEndpoint{ | ||
{ | ||
Description: introspection.EnvDescription, | ||
Path: "/introspect/env", | ||
}, | ||
{ | ||
Description: introspection.NuonDescription, | ||
Path: "/introspect/nuon", | ||
}, | ||
{ | ||
Description: "/livez check", | ||
Path: "/livez", | ||
}, | ||
{ | ||
Description: "/readyz check", | ||
Path: "/readyz", | ||
}, | ||
}, | ||
} | ||
|
||
ctx.JSON(http.StatusOK, resp) | ||
} |
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,36 @@ | ||
module github.com/nuonco/guides/byo-vpc-tutorial/components/docker-image | ||
|
||
go 1.22.1 | ||
|
||
require ( | ||
github.com/gin-gonic/gin v1.9.1 | ||
github.com/go-playground/validator/v10 v10.19.0 | ||
go.uber.org/zap v1.27.0 | ||
) | ||
|
||
require ( | ||
github.com/bytedance/sonic v1.9.1 // indirect | ||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect | ||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect | ||
github.com/gin-contrib/sse v0.1.0 // indirect | ||
github.com/go-playground/locales v0.14.1 // indirect | ||
github.com/go-playground/universal-translator v0.18.1 // indirect | ||
github.com/goccy/go-json v0.10.2 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/klauspost/cpuid/v2 v2.2.4 // indirect | ||
github.com/leodido/go-urn v1.4.0 // indirect | ||
github.com/mattn/go-isatty v0.0.19 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect | ||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect | ||
github.com/ugorji/go/codec v1.2.11 // indirect | ||
go.uber.org/multierr v1.10.0 // indirect | ||
golang.org/x/arch v0.3.0 // indirect | ||
golang.org/x/crypto v0.19.0 // indirect | ||
golang.org/x/net v0.21.0 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
google.golang.org/protobuf v1.30.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.