Documentation
¶
Index ¶
- func ClearDBForTesting(client Client) error
- func ReadQuery(client Client, query string, args map[string]interface{}) ([]interface{}, error)
- func ReadQueryForTesting(client Client, query string, args map[string]interface{}) ([][]interface{}, error)
- func WriteQueryForTesting(client Client, query string, args map[string]interface{}) error
- type AuthToken
- type Client
- type Transaction
- type TransactionWork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDBForTesting ¶
ClearDBForTesting clears the entire database.
It is very slow on large amounts of data!
func ReadQueryForTesting ¶
func ReadQueryForTesting(client Client, query string, args map[string]interface{}) ([][]interface{}, error)
ReadQueryForTesting runs a simple read query against the graph database.
Returns the result as an interface to be handled by the caller (as records), but this is not optimal to use in production!
Types ¶
type AuthToken ¶
AuthToken is the authentication token needed for connecting to the graph database. Use the `CreateAuthToken...` functions to create a token.
func CreateAuthTokenForTesting ¶
func CreateAuthTokenForTesting() AuthToken
CreateAuthTokenForTesting creates an empty authentication token to be used in testing!
func CreateAuthTokenWithUsernameAndPassword ¶
func CreateAuthTokenWithUsernameAndPassword(username string, password string, realm string) AuthToken
CreateAuthTokenWithUsernameAndPassword creates a simple authentication token with username, password and authentication realm. This is the method to call in most scenarios when you need an `AuthToken`.
type Client ¶
Client represents a client to the graph database. TODO(mihaimaruseac): Switch to v5 and `...WithContext` API when v5 is released.
func EmptyClientForTesting ¶
EmptyClientForTesting returns a client to an empty database.
Should only be used for testing.
type Transaction ¶
type Transaction = neo4j.Transaction
Transaction is a transaction in the database
type TransactionWork ¶
type TransactionWork = neo4j.TransactionWork
TransactionWork represents work done inside a `Transaction`.