@@ -65,6 +65,7 @@ func (s *mqlJournaldConfig) file() (*mqlFile, error) {
6565 return f .(* mqlFile ), nil
6666}
6767
68+ // parses the journald config file and creates the resources
6869func (s * mqlJournaldConfig ) parse (file * mqlFile ) error {
6970 s .lock .Lock ()
7071 defer s .lock .Unlock ()
@@ -103,7 +104,6 @@ func (s *mqlJournaldConfig) parse(file *mqlFile) error {
103104
104105 for j , unitParam := range unitSection .Params {
105106 val := unitParam .Value
106- // Apply downcase logic for boolean keywords
107107 if slices .Contains (journaldDowncaseKeywords , unitParam .Name ) {
108108 val = strings .ToLower (val )
109109 }
@@ -140,6 +140,7 @@ func (s *mqlJournaldConfig) parse(file *mqlFile) error {
140140 return s .Sections .Error
141141}
142142
143+ // returns the sections of the journald config, eg [Journal], [Upload], etc
143144func (s * mqlJournaldConfig ) sections (file * mqlFile ) ([]any , error ) {
144145 if err := s .parse (file ); err != nil {
145146 return nil , err
@@ -154,15 +155,13 @@ func (s *mqlJournaldConfig) params(file *mqlFile) (map[string]any, error) {
154155 }
155156
156157 // For backward compatibility, return the [Journal] section's params as a map
157- // Find the Journal section
158158 for _ , sectionAny := range s .Sections .Data {
159159 section := sectionAny .(* mqlJournaldConfigSection )
160160 name := section .GetName ()
161161 if name .Error != nil {
162162 continue
163163 }
164164
165- // Only return params from the Journal section for backward compatibility
166165 if name .Data != "Journal" {
167166 continue
168167 }
@@ -172,8 +171,6 @@ func (s *mqlJournaldConfig) params(file *mqlFile) (map[string]any, error) {
172171 return nil , params .Error
173172 }
174173
175- // Convert params array to map[string]any
176- // If there are duplicate keys, the last one wins
177174 result := make (map [string ]any , len (params .Data ))
178175 for _ , paramAny := range params .Data {
179176 param := paramAny .(* mqlJournaldConfigSectionParam )
0 commit comments