Documentation
¶
Index ¶
- type AssetRegistry
- type AssetTemporaryIDGenerator
- type MariaDB
- func (m *MariaDB) Close() error
- func (m *MariaDB) CountAssets() (int64, error)
- func (m *MariaDB) CountRelations() (int64, error)
- func (m *MariaDB) FlushAll() error
- func (m *MariaDB) InitializeSchema() error
- func (m *MariaDB) ListSources(ctx context.Context) (map[string]string, error)
- func (m *MariaDB) LoadSchema(ctx context.Context, sourceName string) (schema.SchemaGraph, error)
- func (m *MariaDB) Query(ctx context.Context, sql knowledge.SQLTranslation) (*knowledge.GraphQueryResult, error)
- func (m *MariaDB) ReadGraph(sourceName string, graph *knowledge.Graph) error
- func (m *MariaDB) SaveFailedQuery(ctx context.Context, cypher, sql string, err error) error
- func (m *MariaDB) SaveSchema(ctx context.Context, sourceName string, schema schema.SchemaGraph) error
- func (m *MariaDB) SaveSuccessfulQuery(ctx context.Context, cypher, sql string, duration time.Duration) error
- func (m *MariaDB) UpdateGraph(source string, bulk *knowledge.GraphUpdatesBulk) error
- type MariaDBCursor
- type SourceRelation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetRegistry ¶
type AssetRegistry struct {
// contains filtered or unexported fields
}
AssetRegistry store ID of assets in a cache
type AssetTemporaryIDGenerator ¶ added in v0.0.13
type AssetTemporaryIDGenerator struct { // map the DB ID with a temporarily generated ID. DBIDToTemporaryID map[int]int // map the Asset definition to the temporarily generated ID DefinitionToTemporaryID map[knowledge.Asset]int // contains filtered or unexported fields }
AssetTemporaryIDGenerator is a kind of cache associating IDs to assets so that pivot points are joined by those IDs
func NewAssetTemporaryIDGenerator ¶ added in v0.0.13
func NewAssetTemporaryIDGenerator() *AssetTemporaryIDGenerator
NewAssetTemporaryIDGenerator create an ID Generator
func (*AssetTemporaryIDGenerator) Count ¶ added in v0.0.13
func (atig *AssetTemporaryIDGenerator) Count() int
Count the number of items in the generator
type MariaDB ¶
type MariaDB struct {
// contains filtered or unexported fields
}
MariaDB mariadb as graph storage backend
func NewMariaDB ¶
func NewMariaDB(username string, password string, host string, databaseName string, allowCleartextPassword bool) *MariaDB
NewMariaDB create an instance of mariadb
func (*MariaDB) CountAssets ¶
CountAssets count the total number of assets in db.
func (*MariaDB) CountRelations ¶
CountRelations count the total number of relations in db.
func (*MariaDB) InitializeSchema ¶
InitializeSchema initialize the schema of the database
func (*MariaDB) ListSources ¶
ListSources list sources with their authentication tokens
func (*MariaDB) LoadSchema ¶
LoadSchema load the schema graph of the source from DB
func (*MariaDB) Query ¶
func (m *MariaDB) Query(ctx context.Context, sql knowledge.SQLTranslation) (*knowledge.GraphQueryResult, error)
Query the database with provided intermediate query representation
func (*MariaDB) SaveFailedQuery ¶ added in v0.0.6
SaveFailedQuery log an entry to mark a failed query
func (*MariaDB) SaveSchema ¶
func (m *MariaDB) SaveSchema(ctx context.Context, sourceName string, schema schema.SchemaGraph) error
SaveSchema save the schema graph in database
func (*MariaDB) SaveSuccessfulQuery ¶ added in v0.0.6
func (m *MariaDB) SaveSuccessfulQuery(ctx context.Context, cypher, sql string, duration time.Duration) error
SaveSuccessfulQuery log an entry to mark a successful query
func (*MariaDB) UpdateGraph ¶
func (m *MariaDB) UpdateGraph(source string, bulk *knowledge.GraphUpdatesBulk) error
UpdateGraph update graph with bulk of operations
type MariaDBCursor ¶
type MariaDBCursor struct { *sql.Rows Projections []knowledge.Projection // contains filtered or unexported fields }
MariaDBCursor is a cursor of data retrieved by MariaDB
func NewMariaDBCursor ¶ added in v0.0.13
func NewMariaDBCursor(rows *sql.Rows, projections []knowledge.Projection) *MariaDBCursor
NewMariaDBCursor create a new instance of MariaDBCursor
func (*MariaDBCursor) HasMore ¶
func (mc *MariaDBCursor) HasMore() bool
HasMore tells whether there are more data to retrieve from the cursor
type SourceRelation ¶
SourceRelation represent a relation coming from a source