MCPcopy Create free account
hub / github.com/AdRoll/baker / main

Function main

examples/basic/main.go:15–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13)
14
15func main() {
16 toml := `
17[fields]
18 names=["timestamp", "source", "target"]
19
20[input]
21name = "List"
22
23 [input.config]
24 files=["testdata/input.csv.zst"]
25
26[[filter]]
27name="ReplaceFields"
28 [filter.config]
29 ReplaceFields=["replaced", "timestamp"]
30
31[output]
32name = "FileWriter"
33procs=1
34
35 [output.config]
36 PathString="/tmp/_out/output.csv.gz"
37`
38 c := baker.Components{
39 Inputs: input.All,
40 Outputs: output.All,
41 Filters: filter.All,
42 }
43 cfg, err := baker.NewConfigFromToml(strings.NewReader(toml), c)
44 if err != nil {
45 log.Fatal(err)
46 }
47
48 if err := baker.Main(cfg); err != nil {
49 log.Fatal(err)
50 }
51}

Callers

nothing calls this directly

Calls 2

NewConfigFromTomlFunction · 0.92
MainFunction · 0.92

Tested by

no test coverage detected