ReadOnlyFactStore provides read access to a set of facts.
| 25 | |
| 26 | // ReadOnlyFactStore provides read access to a set of facts. |
| 27 | type ReadOnlyFactStore interface { |
| 28 | // Returns a stream of facts that match a given atom. It takes a callback |
| 29 | // to process results. If the callback returns an error, or it encounters |
| 30 | // a malformed atom, scanning stops and that error is returned. |
| 31 | GetFacts(ast.Atom, func(ast.Atom) error) error |
| 32 | |
| 33 | // Contains returns true if given atom is already present in store. |
| 34 | // This is a convenience method that has a straightforward implementation |
| 35 | // in terms of GetFacts. It does not return error and treats any |
| 36 | // error condition as "false". Clients who distinguish "absent" from "error" |
| 37 | // should call GetFacts directly. |
| 38 | Contains(ast.Atom) bool |
| 39 | |
| 40 | // ListPredicates lists predicates available in this store. |
| 41 | ListPredicates() []ast.PredicateSym |
| 42 | |
| 43 | // EstimateFactCount returns the estimated number of facts in the store. |
| 44 | EstimateFactCount() int |
| 45 | } |
| 46 | |
| 47 | // FactStore provides access to a set of facts. |
| 48 | type FactStore interface { |
no outgoing calls
no test coverage detected