MCPcopy
hub / github.com/bettercap/bettercap / LoadData

Method LoadData

modules/can/can_dbc.go:34–54  ·  view source on GitHub ↗
(mod *CANModule, name string, input []byte)

Source from the content-addressed store, hash-verified

32}
33
34func (dbc *DBC) LoadData(mod *CANModule, name string, input []byte) error {
35 dbc.Lock()
36 defer dbc.Unlock()
37
38 mod.Debug("compiling %s ...", name)
39
40 result, err := dbcCompile(name, input)
41 if err != nil {
42 return fmt.Errorf("can't compile %s: %v", name, err)
43 }
44
45 for _, warning := range result.Warnings {
46 mod.Warning("%v", warning)
47 }
48
49 dbc.path = name
50 dbc.db = result.Database
51
52 mod.Info("%s loaded", name)
53 return nil
54}
55
56func (dbc *DBC) Parse(mod *CANModule, msg *Message) bool {
57 dbc.RLock()

Callers 1

LoadFileMethod · 0.95

Calls 6

dbcCompileFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
DebugMethod · 0.45
WarningMethod · 0.45
InfoMethod · 0.45

Tested by

no test coverage detected