What is the role of libbeat/beat.go/type BeatConfig struct?

type BeatConfig struct {
Shipper publisher.ShipperConfig config:",inline"
Output map[string]*common.Config config:"output"
Logging logp.Logging config:"logging"
Processors processors.PluginConfig config:"processors"
Path paths.Path config:"path"
Dashboards *common.Config config:"dashboards"
}

There is already a yml file, why the drug defines the structure?

It's used to hold the parsed configuration file in an accessible structure.

Your answer solved my question, thank you.