@@ -62,46 +62,48 @@ type Configuration struct {
62
62
63
63
// Context is the object passed on the templates which contains all the needed details.
64
64
type Context struct {
65
- StartTime time.Time
66
- TemplateDir string
67
- TemplateType []string
68
- GeneratedObjects int64
69
- GeneratedBytes int64
70
- Num int
71
- NumTemplates int
72
- Range []int
73
- Frequency time.Duration
74
- Duration time.Duration
75
- Locale string
76
- Seed int64
77
- CtxCounters map [string ]int
78
- Ctx map [string ]string
79
- CtxList map [string ][]string
80
- LastIndex int
81
- CountryIndex int
82
- CityIndex int
65
+ StartTime time.Time
66
+ TemplateDir string
67
+ TemplateType []string
68
+ PreloadTemplateType []string
69
+ GeneratedObjects int64
70
+ GeneratedBytes int64
71
+ Num int
72
+ NumTemplates int
73
+ Range []int
74
+ Frequency time.Duration
75
+ Duration time.Duration
76
+ Locale string
77
+ Seed int64
78
+ CtxCounters map [string ]int
79
+ Ctx map [string ]string
80
+ CtxList map [string ][]string
81
+ LastIndex int
82
+ CountryIndex int
83
+ CityIndex int
83
84
}
84
85
85
86
func init () {
86
87
87
88
JrContext = Context {
88
- StartTime : time .Now (),
89
- TemplateDir : os .ExpandEnv (TEMPLATEDIR ),
90
- TemplateType : make ([]string , NUM_TEMPLATES ),
91
- GeneratedBytes : 0 ,
92
- GeneratedObjects : 0 ,
93
- Num : NUM ,
94
- NumTemplates : NUM_TEMPLATES ,
95
- Range : make ([]int , NUM ),
96
- Frequency : FREQUENCY ,
97
- Duration : DURATION ,
98
- Locale : "us" ,
99
- Seed : time .Now ().UTC ().UnixNano (),
100
- CtxCounters : make (map [string ]int ),
101
- Ctx : make (map [string ]string ),
102
- CtxList : make (map [string ][]string ),
103
- LastIndex : - 1 ,
104
- CountryIndex : 232 ,
105
- CityIndex : - 1 ,
89
+ StartTime : time .Now (),
90
+ TemplateDir : os .ExpandEnv (TEMPLATEDIR ),
91
+ TemplateType : make ([]string , NUM_TEMPLATES ),
92
+ PreloadTemplateType : make ([]string , NUM_TEMPLATES ),
93
+ GeneratedBytes : 0 ,
94
+ GeneratedObjects : 0 ,
95
+ Num : NUM ,
96
+ NumTemplates : NUM_TEMPLATES ,
97
+ Range : make ([]int , NUM ),
98
+ Frequency : FREQUENCY ,
99
+ Duration : DURATION ,
100
+ Locale : "us" ,
101
+ Seed : time .Now ().UTC ().UnixNano (),
102
+ CtxCounters : make (map [string ]int ),
103
+ Ctx : make (map [string ]string ),
104
+ CtxList : make (map [string ][]string ),
105
+ LastIndex : - 1 ,
106
+ CountryIndex : 232 ,
107
+ CityIndex : - 1 ,
106
108
}
107
109
}
0 commit comments