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
Commits
b041945f
Commit
b041945f
authored
2 years ago
by
Yordan Kinkov
Browse files
Options
Downloads
Patches
Plain Diff
#2
merge request review comments
parent
377312bc
No related branches found
No related tags found
2 merge requests
!3
Create SET cache endpoint
,
!2
Resolve "Create cache GET endpoint"
Pipeline
#49732
passed with stage
in 20 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
go.sum
+592
-0
592 additions, 0 deletions
go.sum
internal/config/config.go
+1
-1
1 addition, 1 deletion
internal/config/config.go
internal/service/cache/service.go
+2
-2
2 additions, 2 deletions
internal/service/cache/service.go
with
595 additions
and
3 deletions
go.sum
+
592
−
0
View file @
b041945f
This diff is collapsed.
Click to expand it.
internal/config/config.go
+
1
−
1
View file @
b041945f
...
...
@@ -11,7 +11,7 @@ type Config struct {
type
httpConfig
struct
{
Host
string
`envconfig:"HTTP_HOST"`
Port
string
`envconfig:"HTTP_PORT" default:"808
3
"`
Port
string
`envconfig:"HTTP_PORT" default:"808
0
"`
IdleTimeout
time
.
Duration
`envconfig:"HTTP_IDLE_TIMEOUT" default:"120s"`
ReadTimeout
time
.
Duration
`envconfig:"HTTP_READ_TIMEOUT" default:"10s"`
WriteTimeout
time
.
Duration
`envconfig:"HTTP_WRITE_TIMEOUT" default:"10s"`
...
...
This diff is collapsed.
Click to expand it.
internal/service/cache/service.go
+
2
−
2
View file @
b041945f
...
...
@@ -22,7 +22,7 @@ type Service struct {
func
New
(
cache
Cache
,
logger
*
zap
.
Logger
)
*
Service
{
return
&
Service
{
cache
:
cache
,
logger
:
logger
.
With
(
zap
.
String
(
"service"
,
"cache"
))
,
logger
:
logger
,
}
}
...
...
@@ -47,6 +47,6 @@ func (s *Service) Get(ctx context.Context, req *cache.CacheGetRequest) ([]byte,
return
data
,
nil
}
func
makeCacheKey
(
key
,
namespace
,
scope
string
)
string
{
func
makeCacheKey
(
namespace
,
scope
,
key
string
)
string
{
return
fmt
.
Sprintf
(
"%s,%s,%s"
,
namespace
,
scope
,
key
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment