NewTemporalStore creates a new TemporalStore.
(opts ...TemporalStoreOption)
| 108 | |
| 109 | // NewTemporalStore creates a new TemporalStore. |
| 110 | func NewTemporalStore(opts ...TemporalStoreOption) *TemporalStore { |
| 111 | s := &TemporalStore{ |
| 112 | facts: make(map[ast.PredicateSym]map[uint64]*IntervalTree), |
| 113 | atoms: make(map[uint64]ast.Atom), |
| 114 | maxIntervalsPerAtom: DefaultMaxIntervalsPerAtom, |
| 115 | } |
| 116 | for _, opt := range opts { |
| 117 | opt(s) |
| 118 | } |
| 119 | return s |
| 120 | } |
| 121 | |
| 122 | // Add adds a temporal fact to the store. |
| 123 | // Returns (true, nil) if added, (false, nil) if duplicate, (false, error) if limit exceeded. |
no outgoing calls