-
Notifications
You must be signed in to change notification settings - Fork 3
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
0 parents
commit 3652883
Showing
2 changed files
with
62 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package logs | ||
|
||
type SearchBackend struct { | ||
Routes []SearchRoute `json:"routes,omitempty"` | ||
Kubernetes KubernetesSearchBackend `json:"kubernetes,omitempty"` | ||
} | ||
|
||
type SearchRoute struct { | ||
Type string `json:"type,omitempty"` | ||
IdPrefix string `json:"idPrefix,omitempty"` | ||
Labels map[string]string `json:"labels,omitempty"` | ||
} | ||
|
||
type KubernetesSearchBackend struct { | ||
Kubeconfig string `json:"kubeconfig,omitempty"` | ||
} | ||
|
||
type SearchParams struct { | ||
// Limit is the maximum number of results to return. | ||
Limit int `json:"limit,omitempty"` | ||
// The page token, returned by a previous call, to request the next page of results. | ||
Page string `json:"page,omitempty"` | ||
Labels map[string]string `json:"labels,omitempty"` | ||
// A generic query string, that is rewritten to the underlying system, | ||
// If the underlying system does not support queries, than this query is applied on the returned results | ||
Query string `json:"query,omitempty"` | ||
// A RFC3339 timestamp or an age string (e.g. "1h", "2d", "1w") | ||
Start string `json:"start,omitempty"` | ||
// A RFC3339 timestamp or an age string (e.g. "1h", "2d", "1w") | ||
End string `json:"end,omitempty"` | ||
// The type of logs to find, e.g. KubernetesNode, KubernetesService, KubernetesPod, VM, etc. Type and ID are used to route search requests | ||
Type string `json:"type,omitempty"` | ||
// The identifier of the type of logs to find, e.g. k8s-node-1, k8s-service-1, k8s-pod-1, vm-1, etc. | ||
// The ID should include include any cluster/namespace/account information required for routing | ||
Id string `json:"id,omitempty"` | ||
} | ||
|
||
type SearchResults struct { | ||
Total int `json:"total,omitempty"` | ||
Results []Result `json:"results,omitempty"` | ||
NextPage string `json:"nextPage,omitempty"` | ||
} | ||
|
||
type Result struct { | ||
// Id is the unique identifier provided by the underlying system, use to link to a point in time of a log stream | ||
Id string `json:"id,omitempty"` | ||
// RFC3339 timestamp | ||
Time string `json:"timestamp,omitempty"` | ||
Message string `json:"message,omitempty"` | ||
Labels map[string]string `json:"labels,omitempty"` | ||
} | ||
|
||
type SearchAPI interface { | ||
Search(q SearchParams) (r SearchResults, err error) | ||
} | ||
|
||
type SearchMapper interface { | ||
MapSearchParams(p SearchParams) ([]SearchParams, error) | ||
} |
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,3 @@ | ||
module github.com/flanksource/flanksource-ui/apm-hub | ||
|
||
go 1.17 |