Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
de87ee1b
Commit
de87ee1b
authored
Jul 21, 2023
by
李科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: format project
parent
7b70817d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/common/tools/RandStr.go
src/common/tools/RandStr.go
+12
-6
src/service/prometheusrule.go
src/service/prometheusrule.go
+1
-1
No files found.
src/common/tools/RandStr.go
View file @
de87ee1b
...
@@ -9,7 +9,9 @@ var CHARS = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
...
@@ -9,7 +9,9 @@ var CHARS = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
"A"
,
"B"
,
"C"
,
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"I"
,
"J"
,
"K"
,
"L"
,
"M"
,
"N"
,
"O"
,
"P"
,
"Q"
,
"R"
,
"S"
,
"T"
,
"U"
,
"V"
,
"W"
,
"X"
,
"Y"
,
"Z"
,
"A"
,
"B"
,
"C"
,
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"I"
,
"J"
,
"K"
,
"L"
,
"M"
,
"N"
,
"O"
,
"P"
,
"Q"
,
"R"
,
"S"
,
"T"
,
"U"
,
"V"
,
"W"
,
"X"
,
"Y"
,
"Z"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"0"
}
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"0"
}
/*RandAllString 生成随机字符串([a~zA~Z0~9])
/*
RandAllString 生成随机字符串([a~zA~Z0~9])
lenNum 长度
lenNum 长度
*/
*/
func
RandAllString
(
lenNum
int
)
string
{
func
RandAllString
(
lenNum
int
)
string
{
...
@@ -22,7 +24,9 @@ func RandAllString(lenNum int) string {
...
@@ -22,7 +24,9 @@ func RandAllString(lenNum int) string {
return
str
.
String
()
return
str
.
String
()
}
}
/*RandNumString 生成随机数字字符串([0~9])
/*
RandNumString 生成随机数字字符串([0~9])
lenNum 长度
lenNum 长度
*/
*/
func
RandNumString
(
lenNum
int
)
string
{
func
RandNumString
(
lenNum
int
)
string
{
...
@@ -34,7 +38,9 @@ func RandNumString(lenNum int) string {
...
@@ -34,7 +38,9 @@ func RandNumString(lenNum int) string {
return
str
.
String
()
return
str
.
String
()
}
}
/*RandString 生成随机字符串(a~zA~Z])
/*
RandString 生成随机字符串(a~zA~Z])
lenNum 长度
lenNum 长度
*/
*/
func
RandString
(
lenNum
int
)
string
{
func
RandString
(
lenNum
int
)
string
{
...
...
src/service/prometheusrule.go
View file @
de87ee1b
...
@@ -74,7 +74,7 @@ func (p *PrometheusRuleSvc) Create(data response.AlertRulesItem) (err error) {
...
@@ -74,7 +74,7 @@ func (p *PrometheusRuleSvc) Create(data response.AlertRulesItem) (err error) {
case
1
:
case
1
:
expr
=
fmt
.
Sprintf
(
"%s <= %s"
,
cast
.
ToString
(
v
.
ThresholdsMin
),
data
.
Expr
)
expr
=
fmt
.
Sprintf
(
"%s <= %s"
,
cast
.
ToString
(
v
.
ThresholdsMin
),
data
.
Expr
)
case
2
:
case
2
:
expr
=
fmt
.
Sprintf
(
"%s <=%s"
,
data
.
Expr
,
cast
.
ToString
(
v
.
ThresholdsMax
))
expr
=
fmt
.
Sprintf
(
"%s <=
%s"
,
data
.
Expr
,
cast
.
ToString
(
v
.
ThresholdsMax
))
case
3
:
case
3
:
expr
=
fmt
.
Sprintf
(
"%s <= %s <=%s"
,
cast
.
ToString
(
v
.
ThresholdsMin
),
data
.
Expr
,
cast
.
ToString
(
v
.
ThresholdsMax
))
expr
=
fmt
.
Sprintf
(
"%s <= %s <=%s"
,
cast
.
ToString
(
v
.
ThresholdsMin
),
data
.
Expr
,
cast
.
ToString
(
v
.
ThresholdsMax
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment