Open ganmao opened 2 years ago
github.com/ovn-org/libovsdb@v0.6.0/client/api.go:185
func (a api) conditionFromModel(any bool, model model.Model, cond ...model.Condition) Conditional {
var conditional Conditional
var err error
tableName, err := a.getTableFromModel(model)
if tableName == "" {
return newErrorConditional(err)
}
if len(cond) == 0 {
conditional, err = newEqualityConditional(a.cache.Mapper(), tableName, any, model)
if err != nil {
conditional = newErrorConditional(err)
}
} else {
conditional, err = newExplicitConditional(a.cache.Mapper(), tableName, any, model, cond...)
if err != nil {
conditional = newErrorConditional(err)
}
}
return conditional
}
You can use Where
to perform server-side matches, i.e: methods such as Delete
, Update
, Mutate
.
If you want to use List
or Get
that operate on the cache, rather than sending commands to the server, you currently need to use WhereCache
. At least until #128 is implemented.
github.com/ovn-org/libovsdb@v0.6.0/client/condition.go:80