Documentation ¶
Index ¶
- type AqlFake
- type AranGoSession
- func (session *AranGoSession) AqlQuery(typ interface{}, dbname string, query string, count bool, batchSize int) error
- func (session *AranGoSession) Connect(username string, password string) error
- func (session *AranGoSession) CreateCollection(dbname string, collectionName string) error
- func (session *AranGoSession) CreateDB(dbname string) error
- func (session *AranGoSession) CreateDocument(dbname string, collectionName string, object interface{}) (models.ArangoID, error)
- func (session *AranGoSession) CreateEdgeCollection(dbname string, edgeName string) error
- func (session *AranGoSession) CreateEdgeDocument(dbname string, edgeName string, from string, to string) (models.ArangoID, error)
- func (session *AranGoSession) CreateGraph(dbname string, graphName string, edgeDefinitions []models.EdgeDefinition) error
- func (session *AranGoSession) CreateUser(username string, password string) error
- func (session *AranGoSession) DropCollection(dbname string, collectionName string) error
- func (session *AranGoSession) DropDB(dbname string) error
- func (session *AranGoSession) DropGraph(dbname string, graphName string) error
- func (session *AranGoSession) DropUser(username string) error
- func (session *AranGoSession) GetCollectionByID(dbname string, id string) (map[string]interface{}, error)
- func (session *AranGoSession) GrantCollection(dbname string, collectionName string, username string, level string) error
- func (session *AranGoSession) GrantDB(dbname string, username string, level string) error
- func (session *AranGoSession) ListCollections(dbname string) ([]string, error)
- func (session *AranGoSession) ListDBs() ([]string, error)
- func (session *AranGoSession) ListGraphs(dbname string) (interface{}, error)
- func (session *AranGoSession) Migrate(migrations ...Migration) error
- func (session *AranGoSession) Query(typ interface{}, methode string, route string, body interface{}) error
- func (session *AranGoSession) TruncateCollection(dbname string, collectionName string) error
- func (session *AranGoSession) UpdateDocument(dbname string, id string, object interface{}) error
- func (session *AranGoSession) Version() (Version, error)
- type Migration
- type MigrationExecute
- type MigrationStatus
- type Session
- type TestSession
- func (session *TestSession) AddAqlFake(aql string, fake AqlFake)
- func (session *TestSession) AqlQuery(typ interface{}, dbname string, query string, count bool, batchSize int) error
- func (session TestSession) Connect(username string, password string) error
- func (session *TestSession) CreateCollection(dbname string, collectionName string) error
- func (session *TestSession) CreateDB(dbname string) error
- func (session *TestSession) CreateDocument(dbname string, collectionName string, object interface{}) (models.ArangoID, error)
- func (session *TestSession) CreateEdgeCollection(dbname string, edgeName string) error
- func (session *TestSession) CreateEdgeDocument(dbname string, edgeName string, from string, to string) (models.ArangoID, error)
- func (session *TestSession) CreateGraph(dbname string, graphName string, edgeDefinitions []models.EdgeDefinition) error
- func (session *TestSession) CreateUser(username string, password string) error
- func (session *TestSession) DropCollection(dbname string, collectionName string) error
- func (session *TestSession) DropDB(dbname string) error
- func (session *TestSession) DropGraph(dbname string, graphName string) error
- func (session *TestSession) DropUser(username string) error
- func (session *TestSession) GetCollectionByID(dbname string, id string) (map[string]interface{}, error)
- func (session *TestSession) GrantCollection(dbname string, collectionName string, username string, level string) error
- func (session *TestSession) GrantDB(dbname string, username string, level string) error
- func (session *TestSession) ListCollections(dbname string) ([]string, error)
- func (session *TestSession) ListDBs() ([]string, error)
- func (session *TestSession) ListGraphs(dbname string) (interface{}, error)
- func (tsession *TestSession) Migrate(migrations ...Migration) error
- func (session *TestSession) Query(typ interface{}, methode string, route string, body interface{}) error
- func (session *TestSession) TruncateCollection(dbname string, collectionName string) error
- func (session *TestSession) UpdateDocument(dbname string, id string, object interface{}) error
- func (session *TestSession) Version() (Version, error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AranGoSession ¶
type AranGoSession struct {
// contains filtered or unexported fields
}
AranGoSession represent to Session
func NewAranGoDriverSession ¶
func NewAranGoDriverSession(host string) *AranGoSession
NewAranGoDriverSession creates a new instance of a AranGoDriver-Session. Need a host (e.g. "http://localhost:8529/")
func (*AranGoSession) AqlQuery ¶
func (session *AranGoSession) AqlQuery(typ interface{}, dbname string, query string, count bool, batchSize int) error
AqlQuery send a query
func (*AranGoSession) Connect ¶
func (session *AranGoSession) Connect(username string, password string) error
Connect to arangoDB
func (*AranGoSession) CreateCollection ¶
func (session *AranGoSession) CreateCollection(dbname string, collectionName string) error
CreateCollection creates a collection
func (*AranGoSession) CreateDB ¶
func (session *AranGoSession) CreateDB(dbname string) error
CreateDB creates a new db
func (*AranGoSession) CreateDocument ¶
func (session *AranGoSession) CreateDocument(dbname string, collectionName string, object interface{}) (models.ArangoID, error)
CreateDocument creates a document in a collection in a database
func (*AranGoSession) CreateEdgeCollection ¶
func (session *AranGoSession) CreateEdgeCollection(dbname string, edgeName string) error
CreateEdgeCollection creates a edge to DB
func (*AranGoSession) CreateEdgeDocument ¶
func (*AranGoSession) CreateGraph ¶
func (session *AranGoSession) CreateGraph(dbname string, graphName string, edgeDefinitions []models.EdgeDefinition) error
func (*AranGoSession) CreateUser ¶
func (session *AranGoSession) CreateUser(username string, password string) error
Add a new database user
func (*AranGoSession) DropCollection ¶
func (session *AranGoSession) DropCollection(dbname string, collectionName string) error
DropCollection deletes a collection
func (*AranGoSession) DropDB ¶
func (session *AranGoSession) DropDB(dbname string) error
DropDB drop a database
func (*AranGoSession) DropGraph ¶
func (session *AranGoSession) DropGraph(dbname string, graphName string) error
func (*AranGoSession) DropUser ¶
func (session *AranGoSession) DropUser(username string) error
Delete an existing user
func (*AranGoSession) GetCollectionByID ¶
func (session *AranGoSession) GetCollectionByID(dbname string, id string) (map[string]interface{}, error)
GetCollectionByID search collection by id
func (*AranGoSession) GrantCollection ¶
func (session *AranGoSession) GrantCollection(dbname string, collectionName string, username string, level string) error
Set the accesslevel for an user on a collection Possible values for level are: rw, ro and none
func (*AranGoSession) GrantDB ¶
func (session *AranGoSession) GrantDB(dbname string, username string, level string) error
Set the accesslevel for an user on a database Possible values for level are: rw, ro and none
func (*AranGoSession) ListCollections ¶
func (session *AranGoSession) ListCollections(dbname string) ([]string, error)
func (*AranGoSession) ListDBs ¶
func (session *AranGoSession) ListDBs() ([]string, error)
ListDBs lists all db's
func (*AranGoSession) ListGraphs ¶
func (session *AranGoSession) ListGraphs(dbname string) (interface{}, error)
func (*AranGoSession) Migrate ¶
func (session *AranGoSession) Migrate(migrations ...Migration) error
Migrate migrates a migration
func (*AranGoSession) Query ¶
func (session *AranGoSession) Query(typ interface{}, methode string, route string, body interface{}) error
func (*AranGoSession) TruncateCollection ¶
func (session *AranGoSession) TruncateCollection(dbname string, collectionName string) error
TruncateCollection truncate collections
func (*AranGoSession) UpdateDocument ¶
func (session *AranGoSession) UpdateDocument(dbname string, id string, object interface{}) error
UpdateDocument updates an Object
func (*AranGoSession) Version ¶
func (session *AranGoSession) Version() (Version, error)
Version returns current version
type Migration ¶
type Migration struct { models.ArangoID `json:"-"` Name string `json:"name"` Handle MigrationExecute `json:"-"` Status MigrationStatus `json:"status"` }
Migration represent the whole migration
type MigrationExecute ¶
type MigrationExecute func(Session)
MigrationExecute is the func to execute the migration
type MigrationStatus ¶
type MigrationStatus string
MigrationStatus is like a enum and represent the status
const ( // Started means, the migration has started Started MigrationStatus = "started" // Finished means, the migration has finished Finished MigrationStatus = "finished" )
type Session ¶
type Session interface { Connect(username string, password string) error Version() (Version, error) // users CreateUser(username string, password string) error DropUser(username string) error GrantDB(dbname string, username string, level string) error GrantCollection(dbname string, collectionName string, username string, level string) error // databases ListDBs() ([]string, error) CreateDB(dbname string) error DropDB(dbname string) error ListCollections(dbname string) ([]string, error) CreateCollection(dbname string, collectionName string) error DropCollection(dbname string, collectionName string) error TruncateCollection(dbname string, collectionName string) error CreateEdgeCollection(dbname string, edgeName string) error CreateEdgeDocument(dbname string, edgeName string, from string, to string) (models.ArangoID, error) CreateGraph(dbname string, graphName string, edgeDefinitions []models.EdgeDefinition) error ListGraphs(dbname string) (interface{}, error) DropGraph(dbname string, graphName string) error // GetCollectionByID search collection by id // returns: // -> result as map // -> error if applicable GetCollectionByID(dbname string, id string) (map[string]interface{}, error) CreateDocument(dbname string, collectionName string, object interface{}) (models.ArangoID, error) UpdateDocument(dbname string, id string, object interface{}) error // AqlQuery returns: result as array-map, error AqlQuery(typ interface{}, dbname string, query string, count bool, batchSize int) error // Query with auth Query(typ interface{}, methode string, route string, body interface{}) error Migrate(migration ...Migration) error }
type TestSession ¶
type TestSession struct {
// contains filtered or unexported fields
}
func NewTestSession ¶
func NewTestSession() *TestSession
func (*TestSession) AddAqlFake ¶
func (session *TestSession) AddAqlFake(aql string, fake AqlFake)
func (TestSession) Connect ¶
func (session TestSession) Connect(username string, password string) error
Connect test
func (*TestSession) CreateCollection ¶
func (session *TestSession) CreateCollection(dbname string, collectionName string) error
func (*TestSession) CreateDB ¶
func (session *TestSession) CreateDB(dbname string) error
CreateDB test create a db
func (*TestSession) CreateDocument ¶
func (*TestSession) CreateEdgeCollection ¶
func (session *TestSession) CreateEdgeCollection(dbname string, edgeName string) error
func (*TestSession) CreateEdgeDocument ¶
func (*TestSession) CreateGraph ¶
func (session *TestSession) CreateGraph(dbname string, graphName string, edgeDefinitions []models.EdgeDefinition) error
func (*TestSession) CreateUser ¶
func (session *TestSession) CreateUser(username string, password string) error
func (*TestSession) DropCollection ¶
func (session *TestSession) DropCollection(dbname string, collectionName string) error
func (*TestSession) DropDB ¶
func (session *TestSession) DropDB(dbname string) error
func (*TestSession) DropGraph ¶
func (session *TestSession) DropGraph(dbname string, graphName string) error
func (*TestSession) DropUser ¶
func (session *TestSession) DropUser(username string) error
func (*TestSession) GetCollectionByID ¶
func (session *TestSession) GetCollectionByID(dbname string, id string) (map[string]interface{}, error)
func (*TestSession) GrantCollection ¶
func (*TestSession) GrantDB ¶
func (session *TestSession) GrantDB(dbname string, username string, level string) error
func (*TestSession) ListCollections ¶
func (session *TestSession) ListCollections(dbname string) ([]string, error)
func (*TestSession) ListDBs ¶
func (session *TestSession) ListDBs() ([]string, error)
func (*TestSession) ListGraphs ¶
func (session *TestSession) ListGraphs(dbname string) (interface{}, error)
func (*TestSession) Migrate ¶
func (tsession *TestSession) Migrate(migrations ...Migration) error
func (*TestSession) Query ¶
func (session *TestSession) Query(typ interface{}, methode string, route string, body interface{}) error
func (*TestSession) TruncateCollection ¶
func (session *TestSession) TruncateCollection(dbname string, collectionName string) error
func (*TestSession) UpdateDocument ¶
func (session *TestSession) UpdateDocument(dbname string, id string, object interface{}) error
func (*TestSession) Version ¶
func (session *TestSession) Version() (Version, error)
Version returns hard-codeed the testDB as Version