-
Notifications
You must be signed in to change notification settings - Fork 87
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
85 changed files
with
6,944 additions
and
1,256 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 |
---|---|---|
|
@@ -50,7 +50,7 @@ jobs: | |
echo 'sendNotification=${{ inputs.sendNotification }}' | ||
- name: Setup CUE | ||
uses: cue-lang/setup-cue@1713281ae501e533ff06108005dffeab9e2e5203 | ||
uses: cue-lang/setup-cue@a93fa358375740cd8b0078f76355512b9208acb1 | ||
|
||
- name: Validate Image Metadata | ||
shell: bash | ||
|
@@ -87,7 +87,7 @@ jobs: | |
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Generate Token | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: generate-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
|
@@ -212,7 +212,7 @@ jobs: | |
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Generate Token | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: generate-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
|
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 |
---|---|---|
|
@@ -15,13 +15,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate Token | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: generate-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
private-key: "${{ secrets.APP_PRIVATE_KEY }}" | ||
# https://github.com/actions/add-to-project | ||
- uses: actions/add-to-project@31b3f3ccdc584546fc445612dec3f38ff5edb41c # v0.5.0 | ||
- uses: actions/add-to-project@0609a2702eefb44781da00f8e04901d6e5cd2b92 # v0.6.0 | ||
with: | ||
project-url: https://github.com/users/h3mmy/projects/3 | ||
# PAT needs repo & project scope | ||
|
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Generate Token | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: generate-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
|
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ jobs: | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Generate Token | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: generate-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
token: "${{ steps.app-token.outputs.token }}" | ||
|
||
- name: Renovate | ||
uses: renovatebot/[email protected].1 | ||
uses: renovatebot/[email protected].2 | ||
env: | ||
LOG_LEVEL: ${{ inputs.renovateLogLevel }} | ||
RENOVATE_DRY_RUN: ${{ inputs.dryRun }} | ||
|
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: "Generate Short Lived OAuth App Token (ghs_*)" | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
id: app-token | ||
with: | ||
app-id: "${{ secrets.APP_ID }}" | ||
|
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 @@ | ||
7a84e7b94ef638a7872f95af2c6744d9 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
e037fb995fe0efe88a7c8c1862eb3a64 | ||
5e02ea3dfd6b9c111ff93e1f51888f99 |
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 |
---|---|---|
@@ -1,28 +1,69 @@ | ||
package bot | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/h3mmy/bloopyboi/bot/internal/models" | ||
"github.com/h3mmy/bloopyboi/bot/servers" | ||
pmodels "github.com/h3mmy/bloopyboi/internal/models" | ||
"github.com/labstack/echo/v4" | ||
"github.com/uptrace/opentelemetry-go-extra/otelzap" | ||
"go.uber.org/zap" | ||
) | ||
|
||
var defaultGatewayConfig = &pmodels.GatewayConfig{ | ||
HttpPort: 8080, | ||
GrpcPort: 8081, | ||
} | ||
|
||
type AppInfoServer struct { | ||
servers.UnimplementedInfoServiceServer | ||
} | ||
|
||
type Gateway struct { | ||
logger *otelzap.Logger | ||
meta models.BloopyMeta | ||
echoServ *echo.Echo | ||
config *pmodels.GatewayConfig | ||
} | ||
|
||
func NewGateway() *Gateway { | ||
func NewGateway(cfg *pmodels.GatewayConfig) *Gateway { | ||
echoServ := echo.New() | ||
lgr := otelzap.New(zap.L()) | ||
return &Gateway{ | ||
meta: models.NewBloopyMeta(), | ||
echoServ: echoServ, | ||
config: cfg, | ||
logger: lgr, | ||
} | ||
} | ||
|
||
func NewDefaultGateway() *Gateway { | ||
return NewGateway(defaultGatewayConfig) | ||
} | ||
|
||
func (g *Gateway) Start() error { | ||
return nil | ||
g.echoServ.GET("/info", GetAppInfo) | ||
|
||
return g.echoServ.Start(":8080") | ||
} | ||
|
||
func (g *Gateway) Shutdown(ctx context.Context) error { | ||
return g.echoServ.Shutdown(ctx) | ||
} | ||
|
||
func GetAppInfo(c echo.Context) error { | ||
return c.JSON(200, "Hello World") | ||
} | ||
|
||
// func (g *Gateway) startGRPC() error { | ||
// lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", g.config.GrpcPort)) | ||
// if err != nil { | ||
// g.logger.Error("failed to listen", zap.Error(err)) | ||
// return err | ||
// } | ||
|
||
// gserv := grpc.NewServer() | ||
// servers.RegisterInfoServiceServer(gserv, &AppInfoServer{}) | ||
// return gserv.Serve(lis) | ||
// } |
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
Oops, something went wrong.