Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
5d4348b9
Commit
5d4348b9
authored
3 years ago
by
Francé Wilke
Browse files
Options
Downloads
Patches
Plain Diff
Add offset to api-logs; remove relevant_id
parent
10c2e6fa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api_logs/api-logs.go
+0
-1
0 additions, 1 deletion
api_logs/api-logs.go
search/opensearch_types.go
+1
-0
1 addition, 0 deletions
search/opensearch_types.go
search/time_series.go
+3
-2
3 additions, 2 deletions
search/time_series.go
with
4 additions
and
3 deletions
api_logs/api-logs.go
+
0
−
1
View file @
5d4348b9
...
@@ -147,7 +147,6 @@ type ApiLog struct {
...
@@ -147,7 +147,6 @@ type ApiLog struct {
Username
string
`json:"username,omitempty"`
Username
string
`json:"username,omitempty"`
SourceIP
string
`json:"source_ip,omitempty"`
//only logged for incoming API
SourceIP
string
`json:"source_ip,omitempty"`
//only logged for incoming API
UserAgent
string
`json:"user_agent,omitempty"`
//only for incoming, indicate type of browser when UI
UserAgent
string
`json:"user_agent,omitempty"`
//only for incoming, indicate type of browser when UI
RelevantID
string
`json:"relevant_id,omitempty"`
Request
ApiLogRequest
`json:"request"`
Request
ApiLogRequest
`json:"request"`
Response
ApiLogResponse
`json:"response"`
Response
ApiLogResponse
`json:"response"`
}
}
...
...
This diff is collapsed.
Click to expand it.
search/opensearch_types.go
+
1
−
0
View file @
5d4348b9
...
@@ -37,6 +37,7 @@ type SearchRequestBody struct {
...
@@ -37,6 +37,7 @@ type SearchRequestBody struct {
Size
int64
`json:"size,omitempty"`
Size
int64
`json:"size,omitempty"`
Query
Query
`json:"query"`
Query
Query
`json:"query"`
Sort
[]
map
[
string
]
string
`json:"sort,omitempty"`
Sort
[]
map
[
string
]
string
`json:"sort,omitempty"`
From
int64
`json:"from,omitempty"`
}
}
type
Query
struct
{
type
Query
struct
{
...
...
This diff is collapsed.
Click to expand it.
search/time_series.go
+
3
−
2
View file @
5d4348b9
...
@@ -40,7 +40,7 @@ type TimeSeries interface {
...
@@ -40,7 +40,7 @@ type TimeSeries interface {
// ...
// ...
// }
// }
// }
// }
Search
(
query
Query
,
searchQuery
[]
map
[
string
]
string
,
limit
int64
)
(
docs
map
[
string
]
interface
{},
totalCount
int
,
err
error
)
Search
(
query
Query
,
searchQuery
[]
map
[
string
]
string
,
limit
int64
,
offset
int64
)
(
docs
map
[
string
]
interface
{},
totalCount
int
,
err
error
)
// Get takes the id returned in Search()
// Get takes the id returned in Search()
// The id is uuid assigned by OpenSearch when documents are added with Write().
// The id is uuid assigned by OpenSearch when documents are added with Write().
...
@@ -398,7 +398,7 @@ type IndexSettings struct {
...
@@ -398,7 +398,7 @@ type IndexSettings struct {
//Search
//Search
//Return:
//Return:
// docs will be a slice of the TimeSeries data type
// docs will be a slice of the TimeSeries data type
func
(
ts
*
timeSeries
)
Search
(
query
Query
,
sortQuery
[]
map
[
string
]
string
,
limit
int64
)
(
docs
map
[
string
]
interface
{},
totalCount
int
,
err
error
)
{
func
(
ts
*
timeSeries
)
Search
(
query
Query
,
sortQuery
[]
map
[
string
]
string
,
limit
int64
,
offset
int64
)
(
docs
map
[
string
]
interface
{},
totalCount
int
,
err
error
)
{
if
ts
==
nil
{
if
ts
==
nil
{
return
nil
,
0
,
errors
.
Errorf
(
"time series == nil"
)
return
nil
,
0
,
errors
.
Errorf
(
"time series == nil"
)
}
}
...
@@ -421,6 +421,7 @@ func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit i
...
@@ -421,6 +421,7 @@ func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit i
Size
:
limit
,
Size
:
limit
,
Query
:
query
,
Query
:
query
,
Sort
:
sortQuery
,
Sort
:
sortQuery
,
From
:
offset
,
}
}
jsonBody
,
_
:=
json
.
Marshal
(
body
)
jsonBody
,
_
:=
json
.
Marshal
(
body
)
...
...
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