Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandType ¶
type CommandType int
CommandType differentiates different possible datalog commands.
const ( // Assert - this fact will be added to a database upon application. Assert CommandType = iota // Query - this command will return the results of querying a database // upon application. Query // Retract - remove a fact from a database. Retract )
type Database ¶
type Database interface {
// contains filtered or unexported methods
}
Database holds and generates state for asserted facts and rules. We're mirroring the original implementation's use of 'database'. Unfortunately, this was used to describe a number of different uses for tables mapping From some string id to some type in the original implementation.
func NewDiskLogDB ¶
func NewDiskLogDB(rw io.ReadWriter, backing Database) (Database, error)
NewDiskLogDB returns a database initialized from an io.ReadWritter. All assertions and retractions on this databased will be persisted in the log.
func NewLockingDatabase ¶
func NewLockingDatabase() Database
NewLockingDatabase constructs a new in-memory database with simple locking behavior.
func NewMemDatabase ¶
func NewMemDatabase() Database
NewMemDatabase constructs a new in-memory database.
type DatalogCommand ¶
type DatalogCommand struct { Head LiteralDefinition Body []LiteralDefinition CommandType CommandType }
DatalogCommand a command to mutate or query a gotalog database.
type LiteralDefinition ¶
LiteralDefinition defines a literal PredicateName(Term0, Term1, ...).