MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / OnComplete

Method OnComplete

service/log/iml.go:99–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99func (i *imlLogService) OnComplete() {
100 drivers := log_driver.Drivers()
101 if len(drivers) < 1 {
102 return
103 }
104 ctx := context.Background()
105 for _, driver := range drivers {
106 factory, has := log_driver.GetFactory(driver)
107 if !has {
108 log_print.Errorf("driver %s not found", driver)
109 continue
110 }
111 info, err := i.GetLogSource(ctx, driver)
112 if err != nil {
113 log_print.Errorf("get log source %s error: %s", driver, err)
114 continue
115 }
116 d, _, err := factory.Create(info.Config)
117 if err != nil {
118 log_print.Errorf("create driver %s error: %s,config: %s", driver, err, info.Config)
119 continue
120 }
121 log_driver.SetDriver(driver, d)
122 }
123}
124
125func (i *imlLogService) UpdateLogSource(ctx context.Context, driver string, input *Save) error {
126 s, err := i.store.First(ctx, map[string]interface{}{"driver": driver})

Callers

nothing calls this directly

Calls 3

GetLogSourceMethod · 0.95
DriversMethod · 0.65
CreateMethod · 0.65

Tested by

no test coverage detected