@@ -31,11 +31,11 @@ func (ind Indexer) readDataFile(filename string, ps conf.Endpoint, chin chan str
3131 Path : pth ,
3232 }
3333 fileSize := ind .Util .GetFileSize (filename )
34- if ps .ReturnValues .Size {
34+ if ps .Return .Size {
3535 je .Size = fileSize
3636 }
3737 if ps .MaxReturnSizeBytes > fileSize {
38- if ps .ReturnValues .Content || ps .ReturnValues .SplitMarkdownFrontMatter {
38+ if ps .Return .Content || ps .Return .SplitMarkdownFrontMatter {
3939 je .Content = ind .readFileContent (filename , ps )
4040 }
4141 } else {
@@ -48,13 +48,13 @@ func (ind Indexer) readDataFile(filename string, ps conf.Endpoint, chin chan str
4848 },
4949 )
5050 }
51- if ps .ReturnValues .SplitPath {
51+ if ps .Return .SplitPath {
5252 je .SplitPath = strings .Split (pth , string (filepath .Separator ))
5353 }
54- if ps .ReturnValues .Created {
54+ if ps .Return .Created {
5555 je .Created = ind .Util .GetFileCreated (filename )
5656 }
57- if ps .ReturnValues .LastMod {
57+ if ps .Return .LastMod {
5858 je .LastMod = ind .Util .GetFileLastMod (filename )
5959 }
6060 chout <- je
@@ -68,7 +68,7 @@ func (ind Indexer) readFileContent(filename string, ps conf.Endpoint) (content F
6868 case ".json" , ".toml" , ".yaml" , ".yml" :
6969 content = ind .unmarshal (by , ps )
7070 case ".md" :
71- content = ind .readMarkdown (by , ps .ReturnValues )
71+ content = ind .readMarkdown (by , ps .Return )
7272 default :
7373 content = ind .byteToBody (by )
7474 }
@@ -95,7 +95,7 @@ func (ind Indexer) byteToBody(by []byte) (content FileContent) {
9595func (ind Indexer ) unmarshal (by []byte , ps conf.Endpoint ) (content FileContent ) {
9696 if ind .Util .IsTextData (by ) {
9797
98- for _ , el := range ps .ReturnValues .RegexReplace {
98+ for _ , el := range ps .Return .RegexReplace {
9999 by = []byte (
100100 ind .Util .RxReplaceAll (
101101 string (by ),
@@ -131,11 +131,11 @@ func (ind Indexer) unmarshal(by []byte, ps conf.Endpoint) (content FileContent)
131131 logseal.F {"content" : string (by ), "err" : content .Error },
132132 )
133133 }
134- if ps .ReturnValues .JSONPath != "" {
134+ if ps .Return .JSONPath != "" {
135135 ind .Lg .Trace (
136136 "parse unmarshalled data using json path" ,
137137 logseal.F {
138- "json_path" : ps .ReturnValues .JSONPath ,
138+ "json_path" : ps .Return .JSONPath ,
139139 },
140140 )
141141 marsh , err := json .Marshal (content .Body )
@@ -144,11 +144,11 @@ func (ind Indexer) unmarshal(by []byte, ps conf.Endpoint) (content FileContent)
144144 logseal.F {"error" : err },
145145 )
146146 if err == nil {
147- result := gjson .GetBytes (marsh , ps .ReturnValues .JSONPath )
147+ result := gjson .GetBytes (marsh , ps .Return .JSONPath )
148148 if len (result .String ()) < 1 {
149149 ind .Lg .Warn (
150150 "json path result is empty" ,
151- logseal.F {"json_path" : ps .ReturnValues .JSONPath },
151+ logseal.F {"json_path" : ps .Return .JSONPath },
152152 )
153153 } else {
154154 content = ind .unmarshalJSON ([]byte (result .String ()))
0 commit comments