Setup the filesource with schema info
(ss *schema.Schema)
| 34 | |
| 35 | // Setup the filesource with schema info |
| 36 | func (m *jsonTestSource) Setup(ss *schema.Schema) error { |
| 37 | |
| 38 | fileStore := "localfs" |
| 39 | if os.Getenv("FILESTORE") != "" { |
| 40 | fileStore = os.Getenv("FILESTORE") |
| 41 | } |
| 42 | settings := u.JsonHelper(map[string]interface{}{ |
| 43 | "path": "github", |
| 44 | "filetype": "json", |
| 45 | "format": "github_json", |
| 46 | "type": fileStore, |
| 47 | }) |
| 48 | ss.Conf = &schema.ConfigSource{ |
| 49 | Name: "testjson", |
| 50 | SourceType: "testjson", |
| 51 | Settings: settings, |
| 52 | } |
| 53 | return m.FileSource.Setup(ss) |
| 54 | } |
| 55 | |
| 56 | func lineParser(line []byte) (schema.Message, error) { |
| 57 | gh := make(u.JsonHelper) |