-
Notifications
You must be signed in to change notification settings - Fork 0
/
str.go
75 lines (64 loc) · 1.54 KB
/
str.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
import (
"encoding/json"
)
type RuleKey struct {
UserProfile string
RuleName string
}
type CsvRule struct {
UserProfile string `json:"userProfile"`
OrderNo string `json:"orderNo"`
// false: 本地rule,不需要pcrf下发;
// true: 动态rule,需要pcrf下发,对应config中的“dynamic-only”字段
InstalledByPcrf bool `json:"installedByPcrf"`
RuleName string `json:"ruleName"`
ChargingAction string `json:"chargingAction"`
MonitoringKey string `json:"monitoringKey"`
}
func (c *CsvRule) prt() string {
marshal, _ := json.Marshal(c)
return string(marshal)
}
type CsvFilter struct {
RuleName string
GroupName string
Type string
FilterAction string
}
type CsvFilterKey struct {
GroupName string
Type string
FilterAction string
}
type CsvAction struct {
ChargingName string
ChargingAction string
ChargingType string
}
//----------
type RuleBase struct {
RuleBaseName string
RuleArr []ConfigRule
}
type ConfigRule struct {
Priority string `json:"priority"`
IsDynamic bool `json:"isDynamic"`
GroupOfRuleDefs string `json:"groupOfRuleDefs"`
RuleDef string `json:"ruleDef"`
RuleName string `json:"ruleName"`
ChargingAction string `json:"chargingAction"`
MonitoringKey string `json:"monitoringKey"`
}
type ConfigFilerAction struct {
Actions []string
IsAllLines bool
}
type ConfigAction struct {
ActionName string
ActionPara string
}
func (c *ConfigRule) prt() string {
marshal, _ := json.Marshal(c)
return string(marshal)
}