Skip to content

Commit 15ad37e

Browse files
feat: Ja/demo setup (#3)
* chore: clean up old config files * feat: copy ecs component code from guides repo * feat: add nuon config directory
1 parent 6f0d198 commit 15ad37e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1222
-33
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.terraform

configs/installer.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

nuon.aws-ecs.toml

Lines changed: 0 additions & 14 deletions
This file was deleted.

nuon/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# AWS ECS Application
2+
3+
Example configuration for an AWS ECS Application.
4+
5+
docs: https://docs.nuon.co/tutorials/aws-ecs-app-tutorial

nuon/app_inputs.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#:schema https://api.nuon.co/v1/general/config-schema?source=inputs
2+
[[group]]
3+
name = "app"
4+
description = "Inputs to configure the app that will be deployed."
5+
display_name = "App Configuration"
6+
7+
[[input]]
8+
name = "service_name"
9+
description = "What to name the ECS service"
10+
default = "api"
11+
sensitive = false
12+
display_name = "Service Name"
13+
group = "app"
14+
15+
[[input]]
16+
name = "display_name"
17+
description = "A display name for the service"
18+
default = "Application Programming Interface"
19+
sensitive = false
20+
display_name = "Display Name"
21+
group = "app"
22+
23+
[[input]]
24+
name = "admin_user_email"
25+
description = "An admin user email."
26+
default = "[email protected]"
27+
sensitive = false
28+
display_name = "Admin Email"
29+
group = "app"

nuon/components/docker_image.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#:schema https://api.nuon.co/v1/general/config-schema?source=docker_build
2+
3+
name = "docker_image"
4+
type = "docker_build"
5+
dockerfile = "Dockerfile"
6+
7+
[public_repo]
8+
repo = "nuonco/demo"
9+
directory = "src/docker-image"
10+
branch = "ja/demo-setup"

nuon/components/ecs_service.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#:schema https://api.nuon.co/v1/general/config-schema?source=terraform_module
2+
3+
name = "ecs_service"
4+
type = "terraform_module"
5+
terraform_version = "1.5.3"
6+
7+
[public_repo]
8+
repo = "nuonco/demo"
9+
directory = "src/ecs-service"
10+
branch = "ja/demo-setup"
11+
12+
[vars]
13+
service_name = "{{.nuon.install.inputs.service_name}}"
14+
cluster_arn = "{{.nuon.install.sandbox.outputs.ecs_cluster.arn}}"
15+
image_url = "{{.nuon.components.docker_image.image.repository.uri}}"
16+
image_tag = "{{.nuon.components.docker_image.image.tag}}"
17+
app_id = "{{.nuon.app.id}}"
18+
org_id = "{{.nuon.org.id}}"
19+
install_id = "{{.nuon.install.id}}"
20+
vpc_id = "{{.nuon.install.sandbox.outputs.vpc.id}}"
21+
domain_name = "api.{{.nuon.install.sandbox.outputs.public_domain.name}}"
22+
zone_id = "{{.nuon.install.sandbox.outputs.public_domain.zone_id}}"

nuon/installer.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#:schema https://api.nuon.co/v1/general/config-schema?source=installer
2+
name = "Nuon Demo Installer"
3+
description = "One-click installer for the Nuon Demo App."
4+
documentation_url = "https://docs.nuon.co/quickstart"
5+
community_url = "https://nuon-byoc.slack.com/ssb/redirect"
6+
homepage_url = "https://nuon.co"
7+
github_url = "https://github.com/nuonco"
8+
logo_url = "https://nuon.co/_astro/logo.PEcNPe73_Z1ISTvP.svg"
9+
demo_url = "https://nuon.co/"
10+
favicon_url = "https://nuon.co/_astro/apple-touch-icon.CB8rPL88.png"
11+
12+
# optional fields
13+
og_image_url = ""
14+
copyright_markdown = "© Nuon 2024"
15+
footer_markdown = """
16+
[Terms of Service](https://nuon.co/terms) | Nuon - BYOC | [github.com/nuon](https://github.com/nuon)"
17+
"""
18+
post_install_markdown = """
19+
# AWS ECS App
20+
21+
{{.nuon.app.name}} is being deployed to your cloud. Please stand by.
22+
23+
once live, you can visit clisk this link: [{{nuon.install.sandbox.outputs.public_domain.name}}]({{nuon.install.sandbox.outputs.public_domain.name}})
24+
"""
25+
apps = ['appp8wgwu816ypus1aadcg875s']

nuon/nuon.aws-ecs-app.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#:schema https://api.nuon.co/v1/general/config-schema
2+
3+
# This file contains values for common Nuon application configuration options.
4+
# To use it for your app, edit as needed, create an application called aws-ecs-app and run
5+
#
6+
# nuon apps sync -c nuon.aws-ecs-app.toml
7+
#
8+
# See https://docs.nuon.co/concepts/apps for more information.
9+
10+
version = "v1"
11+
description = "AWS ECS Demo Application."
12+
display_name = "Nuon AWS ECS Demo App"
13+
slack_webhook_url = "https://slack.nuon.co"
14+
15+
# this installer is used for all the apps,
16+
# but it needs to be in one of the app configs we can sync it
17+
[installer]
18+
source = "installer.toml"
19+
20+
[inputs]
21+
source = "app_inputs.toml"
22+
23+
[runner]
24+
runner_type = "aws-ecs"
25+
26+
[sandbox]
27+
terraform_version = "1.5.4"
28+
# https://docs.nuon.co/guides/install-access-delegation#setup-delegation
29+
aws_delegation_iam_role_arn = "arn:aws:iam::949309607565:role/aws-ecs-app"
30+
[public_repo]
31+
directory = "aws-ecs"
32+
repo = "nuonco/sandboxes"
33+
branch = "main"
34+
35+
[[components]]
36+
source = "components/docker_image.toml"
37+
38+
[[components]]
39+
source = "components/ecs_service.toml"

src/docker-image/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.22.1
2+
3+
WORKDIR /app
4+
COPY ./ ./
5+
RUN go mod download
6+
COPY *.go ./
7+
RUN CGO_ENABLED=0 GOOS=linux go build -o /api
8+
9+
EXPOSE 8080
10+
CMD ["/api"]

src/docker-image/discover.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package main
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/gin-gonic/gin"
7+
"github.com/nuonco/guides/aws-ecs-tutorial/components/docker-image/internal/introspection"
8+
)
9+
10+
type discoverEndpoint struct {
11+
Path string `json:"path"`
12+
Description string `json:"description"`
13+
}
14+
15+
type discoverResponse struct {
16+
Description string `json:"description"`
17+
Endpoints []discoverEndpoint `json:"endpoints"`
18+
}
19+
20+
func discoverHandler(ctx *gin.Context) {
21+
resp := &discoverResponse{
22+
Description: "This api exposes introspection details of a Nuon app running in a customer's cloud account.",
23+
Endpoints: []discoverEndpoint{
24+
{
25+
Description: introspection.EnvDescription,
26+
Path: "/introspect/env",
27+
},
28+
{
29+
Description: introspection.NuonDescription,
30+
Path: "/introspect/nuon",
31+
},
32+
{
33+
Description: "/livez check",
34+
Path: "/livez",
35+
},
36+
{
37+
Description: "/readyz check",
38+
Path: "/readyz",
39+
},
40+
},
41+
}
42+
43+
ctx.JSON(http.StatusOK, resp)
44+
}

src/docker-image/go.mod

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module github.com/nuonco/guides/aws-ecs-tutorial/components/docker-image
2+
3+
go 1.22.1
4+
5+
require (
6+
github.com/gin-gonic/gin v1.9.1
7+
github.com/go-playground/validator/v10 v10.19.0
8+
go.uber.org/zap v1.27.0
9+
)
10+
11+
require (
12+
github.com/bytedance/sonic v1.9.1 // indirect
13+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
14+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
15+
github.com/gin-contrib/sse v0.1.0 // indirect
16+
github.com/go-playground/locales v0.14.1 // indirect
17+
github.com/go-playground/universal-translator v0.18.1 // indirect
18+
github.com/goccy/go-json v0.10.2 // indirect
19+
github.com/json-iterator/go v1.1.12 // indirect
20+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
21+
github.com/leodido/go-urn v1.4.0 // indirect
22+
github.com/mattn/go-isatty v0.0.19 // indirect
23+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
24+
github.com/modern-go/reflect2 v1.0.2 // indirect
25+
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
26+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
27+
github.com/ugorji/go/codec v1.2.11 // indirect
28+
go.uber.org/multierr v1.10.0 // indirect
29+
golang.org/x/arch v0.3.0 // indirect
30+
golang.org/x/crypto v0.19.0 // indirect
31+
golang.org/x/net v0.21.0 // indirect
32+
golang.org/x/sys v0.17.0 // indirect
33+
golang.org/x/text v0.14.0 // indirect
34+
google.golang.org/protobuf v1.30.0 // indirect
35+
gopkg.in/yaml.v3 v3.0.1 // indirect
36+
)

src/docker-image/go.sum

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
2+
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
3+
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
4+
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
5+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
6+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
7+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
9+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10+
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
11+
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
12+
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
13+
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
14+
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
15+
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
16+
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
17+
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
18+
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
19+
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
20+
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
21+
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
22+
github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4=
23+
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
24+
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
25+
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
26+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
27+
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
28+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
29+
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
30+
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
31+
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
32+
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
33+
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
34+
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
35+
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
36+
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
37+
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
38+
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
39+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
40+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
41+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
42+
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
43+
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
44+
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
45+
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
46+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
47+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
48+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
49+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
50+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
51+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
52+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
53+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
54+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
55+
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
56+
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
57+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
58+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
59+
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
60+
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
61+
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
62+
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
63+
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
64+
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
65+
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
66+
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
67+
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
68+
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
69+
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
70+
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
71+
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
72+
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
73+
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
74+
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
75+
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
76+
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
77+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
78+
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
79+
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
80+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
81+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
82+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
83+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
84+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
85+
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
86+
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
87+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
88+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
89+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
90+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
91+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
92+
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package health
2+
3+
import "github.com/go-playground/validator/v10"
4+
5+
type svc struct {
6+
v *validator.Validate
7+
}
8+
9+
func New(v *validator.Validate) (*svc, error) {
10+
return &svc{
11+
v: v,
12+
}, nil
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package health
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/gin-gonic/gin"
7+
)
8+
9+
func (s *svc) GetLivezHandler(ctx *gin.Context) {
10+
ctx.JSON(http.StatusOK, map[string]interface{}{
11+
"status": "ok",
12+
})
13+
}

0 commit comments

Comments
 (0)