Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cache
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
cache
Merge requests
!2
Resolve "Create cache GET endpoint"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Create cache GET endpoint"
2-implement-cache-get-endpoint
into
main
Overview
12
Commits
5
Pipelines
2
Changes
84
Merged
Yordan Kinkov
requested to merge
2-implement-cache-get-endpoint
into
main
3 years ago
Overview
12
Commits
5
Pipelines
2
Changes
84
Expand
Cache GET endpoint implementation
Closes
#2 (closed)
FYI:
@tziai
@valerii.kalashnikov
0
0
Merge request reports
Compare
main
version 1
377312bc
3 years ago
main (base)
and
latest version
latest version
b041945f
5 commits,
3 years ago
version 1
377312bc
4 commits,
3 years ago
84 files
+
1000
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
84
Search (e.g. *.vue) (Ctrl+P)
cmd/cache/main.go
+
14
−
0
Options
@@ -14,12 +14,16 @@ import (
goa
"goa.design/goa/v3/pkg"
"golang.org/x/sync/errgroup"
goacache
"code.vereign.com/gaiax/tsa/cache/gen/cache"
goahealth
"code.vereign.com/gaiax/tsa/cache/gen/health"
goacachesrv
"code.vereign.com/gaiax/tsa/cache/gen/http/cache/server"
goahealthsrv
"code.vereign.com/gaiax/tsa/cache/gen/http/health/server"
goaopenapisrv
"code.vereign.com/gaiax/tsa/cache/gen/http/openapi/server"
"code.vereign.com/gaiax/tsa/cache/gen/openapi"
"code.vereign.com/gaiax/tsa/cache/internal/clients/redis"
"code.vereign.com/gaiax/tsa/cache/internal/config"
"code.vereign.com/gaiax/tsa/cache/internal/service"
"code.vereign.com/gaiax/tsa/cache/internal/service/cache"
"code.vereign.com/gaiax/tsa/cache/internal/service/health"
"code.vereign.com/gaiax/tsa/golib/graceful"
)
@@ -40,20 +44,27 @@ func main() {
logger
.
Info
(
"start cache service"
,
zap
.
String
(
"version"
,
Version
),
zap
.
String
(
"goa"
,
goa
.
Version
()))
// create redis client
redis
:=
redis
.
New
(
cfg
.
Redis
.
Addr
,
cfg
.
Redis
.
User
,
cfg
.
Redis
.
Pass
,
cfg
.
Redis
.
DB
,
cfg
.
Redis
.
TTL
)
// create services
var
(
cacheSvc
goacache
.
Service
healthSvc
goahealth
.
Service
)
{
cacheSvc
=
cache
.
New
(
redis
,
logger
)
healthSvc
=
health
.
New
()
}
// create endpoints
var
(
cacheEndpoints
*
goacache
.
Endpoints
healthEndpoints
*
goahealth
.
Endpoints
openapiEndpoints
*
openapi
.
Endpoints
)
{
cacheEndpoints
=
goacache
.
NewEndpoints
(
cacheSvc
)
healthEndpoints
=
goahealth
.
NewEndpoints
(
healthSvc
)
openapiEndpoints
=
openapi
.
NewEndpoints
(
nil
)
}
@@ -72,15 +83,18 @@ func main() {
mux
:=
goahttp
.
NewMuxer
()
var
(
cacheServer
*
goacachesrv
.
Server
healthServer
*
goahealthsrv
.
Server
openapiServer
*
goaopenapisrv
.
Server
)
{
cacheServer
=
goacachesrv
.
New
(
cacheEndpoints
,
mux
,
dec
,
enc
,
nil
,
errFormatter
)
healthServer
=
goahealthsrv
.
New
(
healthEndpoints
,
mux
,
dec
,
enc
,
nil
,
errFormatter
)
openapiServer
=
goaopenapisrv
.
New
(
openapiEndpoints
,
mux
,
dec
,
enc
,
nil
,
errFormatter
,
nil
,
nil
)
}
// Configure the mux.
goacachesrv
.
Mount
(
mux
,
cacheServer
)
goahealthsrv
.
Mount
(
mux
,
healthServer
)
goaopenapisrv
.
Mount
(
mux
,
openapiServer
)
Loading