Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
5ec2bc53
Commit
5ec2bc53
authored
1 year ago
by
ensiouel
Browse files
Options
Downloads
Patches
Plain Diff
fix gen
parent
ac80fb8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/items/middleware/metrics_middleware.go
+20
-20
20 additions, 20 deletions
pkg/items/middleware/metrics_middleware.go
with
20 additions
and
20 deletions
pkg/items/middleware/metrics_middleware.go
+
20
−
20
View file @
5ec2bc53
// Code generated by gowrap. DO NOT EDIT.
// Code generated by gowrap. DO NOT EDIT.
// template: ../../assets/templates/middleware/metrics
// template: ../../
../
assets/templates/middleware/metrics
// gowrap: http://github.com/hexdigest/gowrap
// gowrap: http://github.com/hexdigest/gowrap
package
middleware
package
middleware
//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/pkg/items -i Items -t ../../assets/templates/middleware/metrics -o metrics_middleware.go -l ""
//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/pkg/items -i Items -t ../../
../
assets/templates/middleware/metrics -o metrics_middleware.go -l ""
import
(
import
(
"context"
"context"
...
@@ -31,7 +31,7 @@ func MetricsMiddleware(requestMetrics *metrics.RequestMetrics) Middleware {
...
@@ -31,7 +31,7 @@ func MetricsMiddleware(requestMetrics *metrics.RequestMetrics) Middleware {
}
}
}
}
// Aggregate implements Items
// Aggregate implements
items.
Items
func
(
m
metricsMiddleware
)
Aggregate
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
AggregateOptions
)
(
result
map
[
string
]
interface
{},
err
error
)
{
func
(
m
metricsMiddleware
)
Aggregate
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
AggregateOptions
)
(
result
map
[
string
]
interface
{},
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Aggregate"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Aggregate"
))
defer
func
()
{
defer
func
()
{
...
@@ -44,7 +44,7 @@ func (m metricsMiddleware) Aggregate(ctx context.Context, spaceId string, envId
...
@@ -44,7 +44,7 @@ func (m metricsMiddleware) Aggregate(ctx context.Context, spaceId string, envId
return
m
.
next
.
Aggregate
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
return
m
.
next
.
Aggregate
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
}
}
// AggregatePublished implements Items
// AggregatePublished implements
items.
Items
func
(
m
metricsMiddleware
)
AggregatePublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
AggregatePublishedOptions
)
(
result
map
[
string
]
interface
{},
err
error
)
{
func
(
m
metricsMiddleware
)
AggregatePublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
AggregatePublishedOptions
)
(
result
map
[
string
]
interface
{},
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"AggregatePublished"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"AggregatePublished"
))
defer
func
()
{
defer
func
()
{
...
@@ -57,7 +57,7 @@ func (m metricsMiddleware) AggregatePublished(ctx context.Context, spaceId strin
...
@@ -57,7 +57,7 @@ func (m metricsMiddleware) AggregatePublished(ctx context.Context, spaceId strin
return
m
.
next
.
AggregatePublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
return
m
.
next
.
AggregatePublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
}
}
// Archive implements Items
// Archive implements
items.
Items
func
(
m
metricsMiddleware
)
Archive
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
ArchiveOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Archive
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
ArchiveOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Archive"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Archive"
))
defer
func
()
{
defer
func
()
{
...
@@ -70,7 +70,7 @@ func (m metricsMiddleware) Archive(ctx context.Context, item *items.Item, option
...
@@ -70,7 +70,7 @@ func (m metricsMiddleware) Archive(ctx context.Context, item *items.Item, option
return
m
.
next
.
Archive
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Archive
(
ctx
,
item
,
options
...
)
}
}
// Create implements Items
// Create implements
items.
Items
func
(
m
metricsMiddleware
)
Create
(
ctx
context
.
Context
,
item
*
items
.
Item
,
opts
...*
items
.
CreateOptions
)
(
created
*
items
.
Item
,
err
error
)
{
func
(
m
metricsMiddleware
)
Create
(
ctx
context
.
Context
,
item
*
items
.
Item
,
opts
...*
items
.
CreateOptions
)
(
created
*
items
.
Item
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Create"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Create"
))
defer
func
()
{
defer
func
()
{
...
@@ -83,7 +83,7 @@ func (m metricsMiddleware) Create(ctx context.Context, item *items.Item, opts ..
...
@@ -83,7 +83,7 @@ func (m metricsMiddleware) Create(ctx context.Context, item *items.Item, opts ..
return
m
.
next
.
Create
(
ctx
,
item
,
opts
...
)
return
m
.
next
.
Create
(
ctx
,
item
,
opts
...
)
}
}
// Delete implements Items
// Delete implements
items.
Items
func
(
m
metricsMiddleware
)
Delete
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
DeleteOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Delete
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
DeleteOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Delete"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Delete"
))
defer
func
()
{
defer
func
()
{
...
@@ -96,7 +96,7 @@ func (m metricsMiddleware) Delete(ctx context.Context, item *items.Item, options
...
@@ -96,7 +96,7 @@ func (m metricsMiddleware) Delete(ctx context.Context, item *items.Item, options
return
m
.
next
.
Delete
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Delete
(
ctx
,
item
,
options
...
)
}
}
// Find implements Items
// Find implements
items.
Items
func
(
m
metricsMiddleware
)
Find
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
func
(
m
metricsMiddleware
)
Find
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Find"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Find"
))
defer
func
()
{
defer
func
()
{
...
@@ -109,7 +109,7 @@ func (m metricsMiddleware) Find(ctx context.Context, spaceId string, envId strin
...
@@ -109,7 +109,7 @@ func (m metricsMiddleware) Find(ctx context.Context, spaceId string, envId strin
return
m
.
next
.
Find
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
return
m
.
next
.
Find
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
}
}
// FindArchived implements Items
// FindArchived implements
items.
Items
func
(
m
metricsMiddleware
)
FindArchived
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindArchivedOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
func
(
m
metricsMiddleware
)
FindArchived
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindArchivedOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"FindArchived"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"FindArchived"
))
defer
func
()
{
defer
func
()
{
...
@@ -122,7 +122,7 @@ func (m metricsMiddleware) FindArchived(ctx context.Context, spaceId string, env
...
@@ -122,7 +122,7 @@ func (m metricsMiddleware) FindArchived(ctx context.Context, spaceId string, env
return
m
.
next
.
FindArchived
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
return
m
.
next
.
FindArchived
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
}
}
// FindPublished implements Items
// FindPublished implements
items.
Items
func
(
m
metricsMiddleware
)
FindPublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindPublishedOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
func
(
m
metricsMiddleware
)
FindPublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
filter
*
items
.
Filter
,
options
...*
items
.
FindPublishedOptions
)
(
items
[]
*
items
.
Item
,
total
int
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"FindPublished"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"FindPublished"
))
defer
func
()
{
defer
func
()
{
...
@@ -135,7 +135,7 @@ func (m metricsMiddleware) FindPublished(ctx context.Context, spaceId string, en
...
@@ -135,7 +135,7 @@ func (m metricsMiddleware) FindPublished(ctx context.Context, spaceId string, en
return
m
.
next
.
FindPublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
return
m
.
next
.
FindPublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
filter
,
options
...
)
}
}
// Get implements Items
// Get implements
items.
Items
func
(
m
metricsMiddleware
)
Get
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
GetOptions
)
(
item
*
items
.
Item
,
err
error
)
{
func
(
m
metricsMiddleware
)
Get
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
GetOptions
)
(
item
*
items
.
Item
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Get"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Get"
))
defer
func
()
{
defer
func
()
{
...
@@ -148,7 +148,7 @@ func (m metricsMiddleware) Get(ctx context.Context, spaceId string, envId string
...
@@ -148,7 +148,7 @@ func (m metricsMiddleware) Get(ctx context.Context, spaceId string, envId string
return
m
.
next
.
Get
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
return
m
.
next
.
Get
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
}
}
// GetPublished implements Items
// GetPublished implements
items.
Items
func
(
m
metricsMiddleware
)
GetPublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
GetPublishedOptions
)
(
item
*
items
.
Item
,
err
error
)
{
func
(
m
metricsMiddleware
)
GetPublished
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
GetPublishedOptions
)
(
item
*
items
.
Item
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"GetPublished"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"GetPublished"
))
defer
func
()
{
defer
func
()
{
...
@@ -161,7 +161,7 @@ func (m metricsMiddleware) GetPublished(ctx context.Context, spaceId string, env
...
@@ -161,7 +161,7 @@ func (m metricsMiddleware) GetPublished(ctx context.Context, spaceId string, env
return
m
.
next
.
GetPublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
return
m
.
next
.
GetPublished
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
}
}
// GetRevision implements Items
// GetRevision implements
items.
Items
func
(
m
metricsMiddleware
)
GetRevision
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
revisionId
string
,
options
...*
items
.
GetRevisionOptions
)
(
item
*
items
.
Item
,
err
error
)
{
func
(
m
metricsMiddleware
)
GetRevision
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
revisionId
string
,
options
...*
items
.
GetRevisionOptions
)
(
item
*
items
.
Item
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"GetRevision"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"GetRevision"
))
defer
func
()
{
defer
func
()
{
...
@@ -174,7 +174,7 @@ func (m metricsMiddleware) GetRevision(ctx context.Context, spaceId string, envI
...
@@ -174,7 +174,7 @@ func (m metricsMiddleware) GetRevision(ctx context.Context, spaceId string, envI
return
m
.
next
.
GetRevision
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
revisionId
,
options
...
)
return
m
.
next
.
GetRevision
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
revisionId
,
options
...
)
}
}
// Introspect implements Items
// Introspect implements
items.
Items
func
(
m
metricsMiddleware
)
Introspect
(
ctx
context
.
Context
,
item
*
items
.
Item
,
opts
...*
items
.
IntrospectOptions
)
(
itm
*
items
.
Item
,
sch
*
schema
.
Schema
,
err
error
)
{
func
(
m
metricsMiddleware
)
Introspect
(
ctx
context
.
Context
,
item
*
items
.
Item
,
opts
...*
items
.
IntrospectOptions
)
(
itm
*
items
.
Item
,
sch
*
schema
.
Schema
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Introspect"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Introspect"
))
defer
func
()
{
defer
func
()
{
...
@@ -187,7 +187,7 @@ func (m metricsMiddleware) Introspect(ctx context.Context, item *items.Item, opt
...
@@ -187,7 +187,7 @@ func (m metricsMiddleware) Introspect(ctx context.Context, item *items.Item, opt
return
m
.
next
.
Introspect
(
ctx
,
item
,
opts
...
)
return
m
.
next
.
Introspect
(
ctx
,
item
,
opts
...
)
}
}
// ListRevisions implements Items
// ListRevisions implements
items.
Items
func
(
m
metricsMiddleware
)
ListRevisions
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
ListRevisionsOptions
)
(
items
[]
*
items
.
Item
,
err
error
)
{
func
(
m
metricsMiddleware
)
ListRevisions
(
ctx
context
.
Context
,
spaceId
string
,
envId
string
,
collectionId
string
,
itemId
string
,
options
...*
items
.
ListRevisionsOptions
)
(
items
[]
*
items
.
Item
,
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"ListRevisions"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"ListRevisions"
))
defer
func
()
{
defer
func
()
{
...
@@ -200,7 +200,7 @@ func (m metricsMiddleware) ListRevisions(ctx context.Context, spaceId string, en
...
@@ -200,7 +200,7 @@ func (m metricsMiddleware) ListRevisions(ctx context.Context, spaceId string, en
return
m
.
next
.
ListRevisions
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
return
m
.
next
.
ListRevisions
(
ctx
,
spaceId
,
envId
,
collectionId
,
itemId
,
options
...
)
}
}
// Publish implements Items
// Publish implements
items.
Items
func
(
m
metricsMiddleware
)
Publish
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
PublishOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Publish
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
PublishOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Publish"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Publish"
))
defer
func
()
{
defer
func
()
{
...
@@ -213,7 +213,7 @@ func (m metricsMiddleware) Publish(ctx context.Context, item *items.Item, option
...
@@ -213,7 +213,7 @@ func (m metricsMiddleware) Publish(ctx context.Context, item *items.Item, option
return
m
.
next
.
Publish
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Publish
(
ctx
,
item
,
options
...
)
}
}
// Unarchive implements Items
// Unarchive implements
items.
Items
func
(
m
metricsMiddleware
)
Unarchive
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UnarchiveOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Unarchive
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UnarchiveOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Unarchive"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Unarchive"
))
defer
func
()
{
defer
func
()
{
...
@@ -226,7 +226,7 @@ func (m metricsMiddleware) Unarchive(ctx context.Context, item *items.Item, opti
...
@@ -226,7 +226,7 @@ func (m metricsMiddleware) Unarchive(ctx context.Context, item *items.Item, opti
return
m
.
next
.
Unarchive
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Unarchive
(
ctx
,
item
,
options
...
)
}
}
// Undelete implements Items
// Undelete implements
items.
Items
func
(
m
metricsMiddleware
)
Undelete
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UndeleteOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Undelete
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UndeleteOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Undelete"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Undelete"
))
defer
func
()
{
defer
func
()
{
...
@@ -239,7 +239,7 @@ func (m metricsMiddleware) Undelete(ctx context.Context, item *items.Item, optio
...
@@ -239,7 +239,7 @@ func (m metricsMiddleware) Undelete(ctx context.Context, item *items.Item, optio
return
m
.
next
.
Undelete
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Undelete
(
ctx
,
item
,
options
...
)
}
}
// Unpublish implements Items
// Unpublish implements
items.
Items
func
(
m
metricsMiddleware
)
Unpublish
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UnpublishOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Unpublish
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UnpublishOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Unpublish"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Unpublish"
))
defer
func
()
{
defer
func
()
{
...
@@ -252,7 +252,7 @@ func (m metricsMiddleware) Unpublish(ctx context.Context, item *items.Item, opti
...
@@ -252,7 +252,7 @@ func (m metricsMiddleware) Unpublish(ctx context.Context, item *items.Item, opti
return
m
.
next
.
Unpublish
(
ctx
,
item
,
options
...
)
return
m
.
next
.
Unpublish
(
ctx
,
item
,
options
...
)
}
}
// Update implements Items
// Update implements
items.
Items
func
(
m
metricsMiddleware
)
Update
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UpdateOptions
)
(
err
error
)
{
func
(
m
metricsMiddleware
)
Update
(
ctx
context
.
Context
,
item
*
items
.
Item
,
options
...*
items
.
UpdateOptions
)
(
err
error
)
{
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Update"
))
timer
:=
prometheus
.
NewTimer
(
m
.
requestMetrics
.
DurationSeconds
.
WithLabelValues
(
"Items"
,
"Update"
))
defer
func
()
{
defer
func
()
{
...
...
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