Documentation ¶
Overview ¶
Package arangolite provides a lightweight ArangoDB driver.
Package arangolite provides a lightweight ArangoDB driver.
Index ¶
- Variables
- type BaseIndex
- type CollectionInfo
- type CollectionInfoList
- type Count
- type CreateCollection
- type CreateDatabase
- type CreateGraph
- type DB
- func (db *DB) Connect(url, database, username, password string) *DB
- func (db *DB) LoggerOptions(enabled, printQuery, printResult bool) *DB
- func (db *DB) Run(q Runnable) ([]byte, error)
- func (db *DB) RunAndDecode(q Runnable, ptr interface{}) error
- func (db *DB) RunAsync(q Runnable) (*Result, error)
- func (db *DB) RunSync(q Runnable) (*Result, error)
- func (db *DB) Send(description, method, path string, req interface{}) ([]byte, error)
- func (db *DB) SwitchDatabase(database string) *DB
- func (db *DB) SwitchUser(username, password string) *DB
- type Document
- type DropCollection
- type DropDatabase
- type DropGraph
- type Edge
- type EdgeDefinition
- type GetCacheProperties
- type GetCollectionInfo
- type GetGraph
- type Graph
- type GraphData
- type GraphList
- type HashIndex
- type ImportCollection
- type ListCollections
- type ListGraphs
- type PersistentIndex
- type Query
- type Result
- type Runnable
- type SetCacheProperties
- type Transaction
- func (t *Transaction) AddQuery(resultVar, aql string, params ...interface{}) *Transaction
- func (t *Transaction) Bind(name string, value interface{}) *Transaction
- func (t *Transaction) Description() string
- func (t *Transaction) Generate() []byte
- func (t *Transaction) Method() string
- func (t *Transaction) Path() string
- func (t *Transaction) Return(resultVar string) *Transaction
- type TruncateCollection
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoError = errors.New("ERROR_NO_ERROR") ErrFailed = errors.New("ERROR_FAILED") ErrSysError = errors.New("ERROR_SYS_ERROR") ErrOutOfMemory = errors.New("ERROR_OUT_OF_MEMORY") ErrInternal = errors.New("ERROR_INTERNAL") ErrIllegalNumber = errors.New("ERROR_ILLEGAL_NUMBER") ErrNumericOverflow = errors.New("ERROR_NUMERIC_OVERFLOW") ErrIllegalOption = errors.New("ERROR_ILLEGAL_OPTION") ErrDeadPid = errors.New("ERROR_DEAD_PID") ErrNotImplemented = errors.New("ERROR_NOT_IMPLEMENTED") ErrBadParameter = errors.New("ERROR_BAD_PARAMETER") ErrForbidden = errors.New("ERROR_FORBIDDEN") ErrOutOfMemoryMmap = errors.New("ERROR_OUT_OF_MEMORY_MMAP") ErrCorruptedCsv = errors.New("ERROR_CORRUPTED_CSV") ErrFileNotFound = errors.New("ERROR_FILE_NOT_FOUND") ErrCannotWriteFile = errors.New("ERROR_CANNOT_WRITE_FILE") ErrCannotOverwriteFile = errors.New("ERROR_CANNOT_OVERWRITE_FILE") ErrTypeError = errors.New("ERROR_TYPE_ERROR") ErrLockTimeout = errors.New("ERROR_LOCK_TIMEOUT") ErrCannotCreateDirectory = errors.New("ERROR_CANNOT_CREATE_DIRECTORY") ErrCannotCreateTempFile = errors.New("ERROR_CANNOT_CREATE_TEMP_FILE") ErrRequestCanceled = errors.New("ERROR_REQUEST_CANCELED") ErrDebug = errors.New("ERROR_DEBUG") ErrIpAddressInvalid = errors.New("ERROR_IP_ADDRESS_INVALID") ErrFileExists = errors.New("ERROR_FILE_EXISTS") ErrLocked = errors.New("ERROR_LOCKED") ErrDeadlock = errors.New("ERROR_DEADLOCK") ErrShuttingDown = errors.New("ERROR_SHUTTING_DOWN") ErrHttpBadParameter = errors.New("ERROR_HTTP_BAD_PARAMETER") ErrHttpForbidden = errors.New("ERROR_HTTP_FORBIDDEN") ErrHttpNotFound = errors.New("ERROR_HTTP_NOT_FOUND") ErrHttpMethodNotAllowed = errors.New("ERROR_HTTP_METHOD_NOT_ALLOWED") ErrHttpPreconditionFailed = errors.New("ERROR_HTTP_PRECONDITION_FAILED") ErrHttpServerError = errors.New("ERROR_HTTP_SERVER_ERROR") ErrHttpCorruptedJson = errors.New("ERROR_HTTP_CORRUPTED_JSON") ErrHttpSuperfluousSuffices = errors.New("ERROR_HTTP_SUPERFLUOUS_SUFFICES") ErrArangoIllegalState = errors.New("ERROR_ARANGO_ILLEGAL_STATE") ErrArangoDatafileSealed = errors.New("ERROR_ARANGO_DATAFILE_SEALED") ErrArangoUnknownCollectionType = errors.New("ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE") ErrArangoReadOnly = errors.New("ERROR_ARANGO_READ_ONLY") ErrArangoDuplicateIdentifier = errors.New("ERROR_ARANGO_DUPLICATE_IDENTIFIER") ErrArangoDatafileUnreadable = errors.New("ERROR_ARANGO_DATAFILE_UNREADABLE") ErrArangoDatafileEmpty = errors.New("ERROR_ARANGO_DATAFILE_EMPTY") ErrArangoRecovery = errors.New("ERROR_ARANGO_RECOVERY") ErrArangoCorruptedDatafile = errors.New("ERROR_ARANGO_CORRUPTED_DATAFILE") ErrArangoIllegalParameterFile = errors.New("ERROR_ARANGO_ILLEGAL_PARAMETER_FILE") ErrArangoCorruptedCollection = errors.New("ERROR_ARANGO_CORRUPTED_COLLECTION") ErrArangoMmapFailed = errors.New("ERROR_ARANGO_MMAP_FAILED") ErrArangoFilesystemFull = errors.New("ERROR_ARANGO_FILESYSTEM_FULL") ErrArangoNoJournal = errors.New("ERROR_ARANGO_NO_JOURNAL") ErrArangoDatafileAlreadyExists = errors.New("ERROR_ARANGO_DATAFILE_ALREADY_EXISTS") ErrArangoDatadirLocked = errors.New("ERROR_ARANGO_DATADIR_LOCKED") ErrArangoCollectionDirectoryAlreadyExists = errors.New("ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS") ErrArangoMsyncFailed = errors.New("ERROR_ARANGO_MSYNC_FAILED") ErrArangoDatadirUnlockable = errors.New("ERROR_ARANGO_DATADIR_UNLOCKABLE") ErrArangoSyncTimeout = errors.New("ERROR_ARANGO_SYNC_TIMEOUT") ErrArangoConflict = errors.New("ERROR_ARANGO_CONFLICT") ErrArangoDatadirInvalid = errors.New("ERROR_ARANGO_DATADIR_INVALID") ErrArangoDocumentNotFound = errors.New("ERROR_ARANGO_DOCUMENT_NOT_FOUND") ErrArangoCollectionNotFound = errors.New("ERROR_ARANGO_COLLECTION_NOT_FOUND") ErrArangoCollectionParameterMissing = errors.New("ERROR_ARANGO_COLLECTION_PARAMETER_MISSING") ErrArangoDocumentHandleBad = errors.New("ERROR_ARANGO_DOCUMENT_HANDLE_BAD") ErrArangoMaximalSizeTooSmall = errors.New("ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL") ErrArangoDuplicateName = errors.New("ERROR_ARANGO_DUPLICATE_NAME") ErrArangoIllegalName = errors.New("ERROR_ARANGO_ILLEGAL_NAME") ErrArangoNoIndex = errors.New("ERROR_ARANGO_NO_INDEX") ErrArangoUniqueConstraintViolated = errors.New("ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED") ErrArangoIndexNotFound = errors.New("ERROR_ARANGO_INDEX_NOT_FOUND") ErrArangoCrossCollectionRequest = errors.New("ERROR_ARANGO_CROSS_COLLECTION_REQUEST") ErrArangoIndexHandleBad = errors.New("ERROR_ARANGO_INDEX_HANDLE_BAD") ErrArangoDocumentTooLarge = errors.New("ERROR_ARANGO_DOCUMENT_TOO_LARGE") ErrArangoCollectionNotUnloaded = errors.New("ERROR_ARANGO_COLLECTION_NOT_UNLOADED") ErrArangoCollectionTypeInvalid = errors.New("ERROR_ARANGO_COLLECTION_TYPE_INVALID") ErrArangoValidationFailed = errors.New("ERROR_ARANGO_VALIDATION_FAILED") ErrArangoAttributeParserFailed = errors.New("ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED") ErrArangoDocumentKeyBad = errors.New("ERROR_ARANGO_DOCUMENT_KEY_BAD") ErrArangoDocumentKeyUnexpected = errors.New("ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED") ErrArangoDatadirNotWritable = errors.New("ERROR_ARANGO_DATADIR_NOT_WRITABLE") ErrArangoOutOfKeys = errors.New("ERROR_ARANGO_OUT_OF_KEYS") ErrArangoDocumentKeyMissing = errors.New("ERROR_ARANGO_DOCUMENT_KEY_MISSING") ErrArangoDocumentTypeInvalid = errors.New("ERROR_ARANGO_DOCUMENT_TYPE_INVALID") ErrArangoDatabaseNotFound = errors.New("ERROR_ARANGO_DATABASE_NOT_FOUND") ErrArangoDatabaseNameInvalid = errors.New("ERROR_ARANGO_DATABASE_NAME_INVALID") ErrArangoUseSystemDatabase = errors.New("ERROR_ARANGO_USE_SYSTEM_DATABASE") ErrArangoEndpointNotFound = errors.New("ERROR_ARANGO_ENDPOINT_NOT_FOUND") ErrArangoInvalidKeyGenerator = errors.New("ERROR_ARANGO_INVALID_KEY_GENERATOR") ErrArangoInvalidEdgeAttribute = errors.New("ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE") ErrArangoIndexDocumentAttributeMissing = errors.New("ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING") ErrArangoIndexCreationFailed = errors.New("ERROR_ARANGO_INDEX_CREATION_FAILED") ErrArangoWriteThrottleTimeout = errors.New("ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT") ErrArangoCollectionTypeMismatch = errors.New("ERROR_ARANGO_COLLECTION_TYPE_MISMATCH") ErrArangoCollectionNotLoaded = errors.New("ERROR_ARANGO_COLLECTION_NOT_LOADED") ErrArangoDocumentRevBad = errors.New("ERROR_ARANGO_DOCUMENT_REV_BAD") ErrArangoDatafileFull = errors.New("ERROR_ARANGO_DATAFILE_FULL") ErrArangoEmptyDatadir = errors.New("ERROR_ARANGO_EMPTY_DATADIR") ErrReplicationNoResponse = errors.New("ERROR_REPLICATION_NO_RESPONSE") ErrReplicationInvalidResponse = errors.New("ERROR_REPLICATION_INVALID_RESPONSE") ErrReplicationMasterError = errors.New("ERROR_REPLICATION_MASTER_ERROR") ErrReplicationMasterIncompatible = errors.New("ERROR_REPLICATION_MASTER_INCOMPATIBLE") ErrReplicationMasterChange = errors.New("ERROR_REPLICATION_MASTER_CHANGE") ErrReplicationLoop = errors.New("ERROR_REPLICATION_LOOP") ErrReplicationUnexpectedMarker = errors.New("ERROR_REPLICATION_UNEXPECTED_MARKER") ErrReplicationInvalidApplierState = errors.New("ERROR_REPLICATION_INVALID_APPLIER_STATE") ErrReplicationUnexpectedTransaction = errors.New("ERROR_REPLICATION_UNEXPECTED_TRANSACTION") ErrReplicationInvalidApplierConfiguration = errors.New("ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION") ErrReplicationRunning = errors.New("ERROR_REPLICATION_RUNNING") ErrReplicationApplierStopped = errors.New("ERROR_REPLICATION_APPLIER_STOPPED") ErrReplicationNoStartTick = errors.New("ERROR_REPLICATION_NO_START_TICK") ErrReplicationStartTickNotPresent = errors.New("ERROR_REPLICATION_START_TICK_NOT_PRESENT") ErrClusterNoAgency = errors.New("ERROR_CLUSTER_NO_AGENCY") ErrClusterNoCoordinatorHeader = errors.New("ERROR_CLUSTER_NO_COORDINATOR_HEADER") ErrClusterCouldNotLockPlan = errors.New("ERROR_CLUSTER_COULD_NOT_LOCK_PLAN") ErrClusterCollectionIdExists = errors.New("ERROR_CLUSTER_COLLECTION_ID_EXISTS") ErrClusterCouldNotCreateCollectionInPlan = errors.New("ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN") ErrClusterCouldNotReadCurrentVersion = errors.New("ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION") ErrClusterCouldNotCreateCollection = errors.New("ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION") ErrClusterTimeout = errors.New("ERROR_CLUSTER_TIMEOUT") ErrClusterCouldNotRemoveCollectionInPlan = errors.New("ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN") ErrClusterCouldNotRemoveCollectionInCurrent = errors.New("ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT") ErrClusterCouldNotCreateDatabaseInPlan = errors.New("ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN") ErrClusterCouldNotCreateDatabase = errors.New("ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE") ErrClusterCouldNotRemoveDatabaseInPlan = errors.New("ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN") ErrClusterCouldNotRemoveDatabaseInCurrent = errors.New("ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT") ErrClusterShardGone = errors.New("ERROR_CLUSTER_SHARD_GONE") ErrClusterConnectionLost = errors.New("ERROR_CLUSTER_CONNECTION_LOST") ErrClusterMustNotSpecifyKey = errors.New("ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY") ErrClusterGotContradictingAnswers = errors.New("ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS") ErrClusterNotAllShardingAttributesGiven = errors.New("ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN") ErrClusterMustNotChangeShardingAttributes = errors.New("ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES") ErrClusterUnsupported = errors.New("ERROR_CLUSTER_UNSUPPORTED") ErrClusterOnlyOnCoordinator = errors.New("ERROR_CLUSTER_ONLY_ON_COORDINATOR") ErrClusterReadingPlanAgency = errors.New("ERROR_CLUSTER_READING_PLAN_AGENCY") ErrClusterCouldNotTruncateCollection = errors.New("ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION") ErrClusterAqlCommunication = errors.New("ERROR_CLUSTER_AQL_COMMUNICATION") ErrArangoDocumentNotFoundOrShardingAttributesChanged = errors.New("ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED") ErrClusterCouldNotDetermineId = errors.New("ERROR_CLUSTER_COULD_NOT_DETERMINE_ID") ErrClusterOnlyOnDbserver = errors.New("ERROR_CLUSTER_ONLY_ON_DBSERVER") ErrClusterUnknownCallbackEndpoint = errors.New("ERROR_CLUSTER_UNKNOWN_CALLBACK_ENDPOINT") ErrClusterAgencyStructureInvalid = errors.New("ERROR_CLUSTER_AGENCY_STRUCTURE_INVALID") ErrQueryKilled = errors.New("ERROR_QUERY_KILLED") ErrQueryParse = errors.New("ERROR_QUERY_PARSE") ErrQueryEmpty = errors.New("ERROR_QUERY_EMPTY") ErrQueryScript = errors.New("ERROR_QUERY_SCRIPT") ErrQueryNumberOutOfRange = errors.New("ERROR_QUERY_NUMBER_OUT_OF_RANGE") ErrQueryVariableNameInvalid = errors.New("ERROR_QUERY_VARIABLE_NAME_INVALID") ErrQueryVariableRedeclared = errors.New("ERROR_QUERY_VARIABLE_REDECLARED") ErrQueryVariableNameUnknown = errors.New("ERROR_QUERY_VARIABLE_NAME_UNKNOWN") ErrQueryCollectionLockFailed = errors.New("ERROR_QUERY_COLLECTION_LOCK_FAILED") ErrQueryTooManyCollections = errors.New("ERROR_QUERY_TOO_MANY_COLLECTIONS") ErrQueryDocumentAttributeRedeclared = errors.New("ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED") ErrQueryFunctionNameUnknown = errors.New("ERROR_QUERY_FUNCTION_NAME_UNKNOWN") ErrQueryFunctionArgumentNumberMismatch = errors.New("ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH") ErrQueryFunctionArgumentTypeMismatch = errors.New("ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH") ErrQueryInvalidRegex = errors.New("ERROR_QUERY_INVALID_REGEX") ErrQueryBindParametersInvalid = errors.New("ERROR_QUERY_BIND_PARAMETERS_INVALID") ErrQueryBindParameterMissing = errors.New("ERROR_QUERY_BIND_PARAMETER_MISSING") ErrQueryBindParameterUndeclared = errors.New("ERROR_QUERY_BIND_PARAMETER_UNDECLARED") ErrQueryBindParameterType = errors.New("ERROR_QUERY_BIND_PARAMETER_TYPE") ErrQueryInvalidLogicalValue = errors.New("ERROR_QUERY_INVALID_LOGICAL_VALUE") ErrQueryInvalidArithmeticValue = errors.New("ERROR_QUERY_INVALID_ARITHMETIC_VALUE") ErrQueryDivisionByZero = errors.New("ERROR_QUERY_DIVISION_BY_ZERO") ErrQueryArrayExpected = errors.New("ERROR_QUERY_ARRAY_EXPECTED") ErrQueryFailCalled = errors.New("ERROR_QUERY_FAIL_CALLED") ErrQueryGeoIndexMissing = errors.New("ERROR_QUERY_GEO_INDEX_MISSING") ErrQueryFulltextIndexMissing = errors.New("ERROR_QUERY_FULLTEXT_INDEX_MISSING") ErrQueryInvalidDateValue = errors.New("ERROR_QUERY_INVALID_DATE_VALUE") ErrQueryMultiModify = errors.New("ERROR_QUERY_MULTI_MODIFY") ErrQueryInvalidAggregateExpression = errors.New("ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION") ErrQueryCompileTimeOptions = errors.New("ERROR_QUERY_COMPILE_TIME_OPTIONS") ErrQueryExceptionOptions = errors.New("ERROR_QUERY_EXCEPTION_OPTIONS") ErrQueryCollectionUsedInExpression = errors.New("ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION") ErrQueryDisallowedDynamicCall = errors.New("ERROR_QUERY_DISALLOWED_DYNAMIC_CALL") ErrQueryAccessAfterModification = errors.New("ERROR_QUERY_ACCESS_AFTER_MODIFICATION") ErrQueryFunctionInvalidName = errors.New("ERROR_QUERY_FUNCTION_INVALID_NAME") ErrQueryFunctionInvalidCode = errors.New("ERROR_QUERY_FUNCTION_INVALID_CODE") ErrQueryFunctionNotFound = errors.New("ERROR_QUERY_FUNCTION_NOT_FOUND") ErrQueryFunctionRuntimeError = errors.New("ERROR_QUERY_FUNCTION_RUNTIME_ERROR") ErrQueryBadJsonPlan = errors.New("ERROR_QUERY_BAD_JSON_PLAN") ErrQueryNotFound = errors.New("ERROR_QUERY_NOT_FOUND") ErrQueryInUse = errors.New("ERROR_QUERY_IN_USE") ErrCursorNotFound = errors.New("ERROR_CURSOR_NOT_FOUND") ErrCursorBusy = errors.New("ERROR_CURSOR_BUSY") ErrTransactionInternal = errors.New("ERROR_TRANSACTION_INTERNAL") ErrTransactionNested = errors.New("ERROR_TRANSACTION_NESTED") ErrTransactionUnregisteredCollection = errors.New("ERROR_TRANSACTION_UNREGISTERED_COLLECTION") ErrTransactionDisallowedOperation = errors.New("ERROR_TRANSACTION_DISALLOWED_OPERATION") ErrTransactionAborted = errors.New("ERROR_TRANSACTION_ABORTED") ErrUserInvalidName = errors.New("ERROR_USER_INVALID_NAME") ErrUserInvalidPassword = errors.New("ERROR_USER_INVALID_PASSWORD") ErrUserDuplicate = errors.New("ERROR_USER_DUPLICATE") ErrUserNotFound = errors.New("ERROR_USER_NOT_FOUND") ErrUserChangePassword = errors.New("ERROR_USER_CHANGE_PASSWORD") ErrServiceInvalidName = errors.New("ERROR_SERVICE_INVALID_NAME") ErrServiceInvalidMount = errors.New("ERROR_SERVICE_INVALID_MOUNT") ErrServiceDownloadFailed = errors.New("ERROR_SERVICE_DOWNLOAD_FAILED") ErrServiceUploadFailed = errors.New("ERROR_SERVICE_UPLOAD_FAILED") ErrKeyvalueInvalidKey = errors.New("ERROR_KEYVALUE_INVALID_KEY") ErrKeyvalueKeyExists = errors.New("ERROR_KEYVALUE_KEY_EXISTS") ErrKeyvalueKeyNotFound = errors.New("ERROR_KEYVALUE_KEY_NOT_FOUND") ErrKeyvalueKeyNotUnique = errors.New("ERROR_KEYVALUE_KEY_NOT_UNIQUE") ErrKeyvalueKeyNotChanged = errors.New("ERROR_KEYVALUE_KEY_NOT_CHANGED") ErrKeyvalueKeyNotRemoved = errors.New("ERROR_KEYVALUE_KEY_NOT_REMOVED") ErrKeyvalueNoValue = errors.New("ERROR_KEYVALUE_NO_VALUE") ErrTaskInvalidId = errors.New("ERROR_TASK_INVALID_ID") ErrTaskDuplicateId = errors.New("ERROR_TASK_DUPLICATE_ID") ErrTaskNotFound = errors.New("ERROR_TASK_NOT_FOUND") ErrGraphInvalidGraph = errors.New("ERROR_GRAPH_INVALID_GRAPH") ErrGraphCouldNotCreateGraph = errors.New("ERROR_GRAPH_COULD_NOT_CREATE_GRAPH") ErrGraphInvalidVertex = errors.New("ERROR_GRAPH_INVALID_VERTEX") ErrGraphCouldNotCreateVertex = errors.New("ERROR_GRAPH_COULD_NOT_CREATE_VERTEX") ErrGraphCouldNotChangeVertex = errors.New("ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX") ErrGraphInvalidEdge = errors.New("ERROR_GRAPH_INVALID_EDGE") ErrGraphCouldNotCreateEdge = errors.New("ERROR_GRAPH_COULD_NOT_CREATE_EDGE") ErrGraphCouldNotChangeEdge = errors.New("ERROR_GRAPH_COULD_NOT_CHANGE_EDGE") ErrGraphTooManyIterations = errors.New("ERROR_GRAPH_TOO_MANY_ITERATIONS") ErrGraphInvalidFilterResult = errors.New("ERROR_GRAPH_INVALID_FILTER_RESULT") ErrGraphCollectionMultiUse = errors.New("ERROR_GRAPH_COLLECTION_MULTI_USE") ErrGraphCollectionUseInMultiGraphs = errors.New("ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS") ErrGraphCreateMissingName = errors.New("ERROR_GRAPH_CREATE_MISSING_NAME") ErrGraphCreateMalformedEdgeDefinition = errors.New("ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION") ErrGraphNotFound = errors.New("ERROR_GRAPH_NOT_FOUND") ErrGraphDuplicate = errors.New("ERROR_GRAPH_DUPLICATE") ErrGraphVertexColDoesNotExist = errors.New("ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST") ErrGraphWrongCollectionTypeVertex = errors.New("ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX") ErrGraphNotInOrphanCollection = errors.New("ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION") ErrGraphCollectionUsedInEdgeDef = errors.New("ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF") ErrGraphEdgeCollectionNotUsed = errors.New("ERROR_GRAPH_EDGE_COLLECTION_NOT_USED") ErrGraphNotAnArangoCollection = errors.New("ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION") ErrGraphNoGraphCollection = errors.New("ERROR_GRAPH_NO_GRAPH_COLLECTION") ErrGraphInvalidExampleArrayObjectString = errors.New("ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING") ErrGraphInvalidExampleArrayObject = errors.New("ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT") ErrGraphInvalidNumberOfArguments = errors.New("ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS") ErrGraphInvalidParameter = errors.New("ERROR_GRAPH_INVALID_PARAMETER") ErrGraphInvalidId = errors.New("ERROR_GRAPH_INVALID_ID") ErrGraphCollectionUsedInOrphans = errors.New("ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS") ErrGraphEdgeColDoesNotExist = errors.New("ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST") ErrGraphEmpty = errors.New("ERROR_GRAPH_EMPTY") ErrSessionUnknown = errors.New("ERROR_SESSION_UNKNOWN") ErrSessionExpired = errors.New("ERROR_SESSION_EXPIRED") ErrSimpleClientUnknownError = errors.New("SIMPLE_CLIENT_UNKNOWN_ERROR") ErrSimpleClientCouldNotConnect = errors.New("SIMPLE_CLIENT_COULD_NOT_CONNECT") ErrSimpleClientCouldNotWrite = errors.New("SIMPLE_CLIENT_COULD_NOT_WRITE") ErrSimpleClientCouldNotRead = errors.New("SIMPLE_CLIENT_COULD_NOT_READ") ErrMalformedManifestFile = errors.New("ERROR_MALFORMED_MANIFEST_FILE") ErrInvalidServiceManifest = errors.New("ERROR_INVALID_SERVICE_MANIFEST") ErrInvalidFoxxOptions = errors.New("ERROR_INVALID_FOXX_OPTIONS") ErrInvalidMountpoint = errors.New("ERROR_INVALID_MOUNTPOINT") ErrServiceNotFound = errors.New("ERROR_SERVICE_NOT_FOUND") ErrServiceNeedsConfiguration = errors.New("ERROR_SERVICE_NEEDS_CONFIGURATION") ErrServiceMountpointConflict = errors.New("ERROR_SERVICE_MOUNTPOINT_CONFLICT") ErrModuleNotFound = errors.New("ERROR_MODULE_NOT_FOUND") ErrModuleFailure = errors.New("ERROR_MODULE_FAILURE") ErrResultElementExists = errors.New("RESULT_ELEMENT_EXISTS") ErrResultElementNotFound = errors.New("RESULT_ELEMENT_NOT_FOUND") ErrQueueAlreadyExists = errors.New("ERROR_QUEUE_ALREADY_EXISTS") ErrDispatcherIsStopping = errors.New("ERROR_DISPATCHER_IS_STOPPING") ErrQueueUnknown = errors.New("ERROR_QUEUE_UNKNOWN") ErrQueueFull = errors.New("ERROR_QUEUE_FULL") )
-
Functions ¶
This section is empty.
Types ¶
type BaseIndex ¶
type BaseIndex struct { CollectionName string `json:"-"` Fields []string `json:"fields,omitempty"` Unique *bool `json:"unique,omitempty"` Type string `json:"type,omitempty"` Sparse *bool `json:"sparse,omitempty"` }
BaseIndex creates a hash index in database.
func (*BaseIndex) Description ¶
type CollectionInfo ¶
type CollectionInfoList ¶
type CollectionInfoList struct { Collections []CollectionInfo `json:"collections"` Error bool `json:"error"` Code int `json:"code"` }
type Count ¶
type Count struct { Count int64 `json:"count,omitempty"` // contains filtered or unexported fields }
Count -
type CreateCollection ¶
type CreateCollection struct { JournalSize int `json:"journalSize,omitempty"` KeyOptions map[string]interface{} `json:"keyOptions,omitempty"` Name string `json:"name"` WaitForSync *bool `json:"waitForSync,omitempty"` DoCompact *bool `json:"doCompact,omitempty"` IsVolatile *bool `json:"isVolatile,omitempty"` ShardKeys []string `json:"shardKeys,omitempty"` NumberOfShards int `json:"numberOfShards,omitempty"` IsSystem *bool `json:"isSystem,omitempty"` Type int `json:"type,omitempty"` IndexBuckets int `json:"indexBuckets,omitempty"` }
CreateCollection creates a collection in database.
func (*CreateCollection) Description ¶
func (r *CreateCollection) Description() string
func (*CreateCollection) Generate ¶
func (r *CreateCollection) Generate() []byte
func (*CreateCollection) Method ¶
func (r *CreateCollection) Method() string
func (*CreateCollection) Path ¶
func (r *CreateCollection) Path() string
type CreateDatabase ¶
type CreateDatabase struct { Username string `json:"username,omitempty"` Name string `json:"name"` Extra json.RawMessage `json:"extra,omitempty"` Passwd string `json:"passwd,omitempty"` Active *bool `json:"active,omitempty"` Users []map[string]interface{} `json:"users,omitempty"` }
CreateDatabase creates a new database.
func (*CreateDatabase) Description ¶
func (r *CreateDatabase) Description() string
func (*CreateDatabase) Generate ¶
func (r *CreateDatabase) Generate() []byte
func (*CreateDatabase) Method ¶
func (r *CreateDatabase) Method() string
func (*CreateDatabase) Path ¶
func (r *CreateDatabase) Path() string
type CreateGraph ¶
type CreateGraph struct { Name string `json:"name"` EdgeDefinitions []EdgeDefinition `json:"edgeDefinitions",omitempty` OrphanCollections []string `json:"orphanCollections",omitempty` }
CreateGraph creates a collection in database.
func (*CreateGraph) Description ¶
func (c *CreateGraph) Description() string
func (*CreateGraph) Generate ¶
func (c *CreateGraph) Generate() []byte
func (*CreateGraph) Method ¶
func (c *CreateGraph) Method() string
func (*CreateGraph) Path ¶
func (c *CreateGraph) Path() string
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents an access to an ArangoDB database.
func (*DB) LoggerOptions ¶
LoggerOptions sets the Arangolite logger options.
func (*DB) Run ¶
Run runs the Runnable synchronously and returns the JSON array of all elements of every batch returned by the database.
func (*DB) RunAndDecode ¶
RunAndDecode - run and try to decode Response payload into given pointer struct
func (*DB) Send ¶
Send runs a low level request in the database. The description param is shown in the logger. The req param is serialized in the body. The purpose of this method is to be a fallback in case the user wants to do something which is not implemented in the requests.go file.
func (*DB) SwitchDatabase ¶
SwitchDatabase change the current database.
func (*DB) SwitchUser ¶
SwitchUser change the current user.
type Document ¶
type Document struct { // The document handle. Format: ':collection/:key' ID *string `json:"_id,omitempty"` // The document's revision token. Changes at each update. Rev *string `json:"_rev,omitempty"` // The document's unique key. Key *string `json:"_key,omitempty"` }
Document represents a basic ArangoDB document Fields are pointers to allow null values in ArangoDB
type DropCollection ¶
type DropCollection struct {
Name string
}
DropCollection deletes a collection in database.
func (*DropCollection) Description ¶
func (r *DropCollection) Description() string
func (*DropCollection) Generate ¶
func (r *DropCollection) Generate() []byte
func (*DropCollection) Method ¶
func (r *DropCollection) Method() string
func (*DropCollection) Path ¶
func (r *DropCollection) Path() string
type DropDatabase ¶
type DropDatabase struct {
Name string
}
DropDatabase deletes a database.
func (*DropDatabase) Description ¶
func (r *DropDatabase) Description() string
func (*DropDatabase) Generate ¶
func (r *DropDatabase) Generate() []byte
func (*DropDatabase) Method ¶
func (r *DropDatabase) Method() string
func (*DropDatabase) Path ¶
func (r *DropDatabase) Path() string
type Edge ¶
type Edge struct { Document // Reference to another document. Format: ':collection/:key' // Required: true From *string `json:"_from,omitempty"` // Reference to another document. Format: ':collection/:key' // Required: true To *string `json:"_to,omitempty"` }
Edge represents a basic ArangoDB edge Fields are pointers to allow null values in ArangoDB
type EdgeDefinition ¶
type EdgeDefinition struct { Collection string `json:"collection"` From []string `json:"from"` To []string `json:"to"` }
EdgeDefinition is a definition of the graph edges
type GetCacheProperties ¶
type GetCacheProperties struct{}
GetCacheProperties retrieves the current query cache properties.
func (*GetCacheProperties) Description ¶
func (r *GetCacheProperties) Description() string
func (*GetCacheProperties) Generate ¶
func (r *GetCacheProperties) Generate() []byte
func (*GetCacheProperties) Method ¶
func (r *GetCacheProperties) Method() string
func (*GetCacheProperties) Path ¶
func (r *GetCacheProperties) Path() string
type GetCollectionInfo ¶
CollectionInfo gets information about the collection
func (*GetCollectionInfo) Description ¶
func (c *GetCollectionInfo) Description() string
func (*GetCollectionInfo) Generate ¶
func (c *GetCollectionInfo) Generate() []byte
func (*GetCollectionInfo) Method ¶
func (c *GetCollectionInfo) Method() string
func (*GetCollectionInfo) Path ¶
func (c *GetCollectionInfo) Path() string
type GetGraph ¶
type GetGraph struct {
Name string
}
GetGraph gets a graph from the graph module.
func (*GetGraph) Description ¶
type Graph ¶
type Graph struct { Name string `json:"name"` //An array of definitions for the edges EdgeDefinitions []EdgeDefinition `json:"edgeDefinitions",omitempty` //An array of additional vertex collections. OrphanCollections []string `json:"orphanCollections",omitempty` ID string `json:"_id",omitempty` Rev string `json:"_rev",omitempty` }
Graph represents a graph definition.
type GraphData ¶
type GraphData struct {
Graph Graph `json:"graph"`
}
GraphData is a container for data returned by a GET GRAPH request
type GraphList ¶
type GraphList struct {
Graphs []Graph `json:"graphs"`
}
GraphList is a container for data returned by a LIST GRAPHS request
type ImportCollection ¶
ImportCollection imports data to a collection
func (*ImportCollection) Description ¶
func (c *ImportCollection) Description() string
func (*ImportCollection) Generate ¶
func (c *ImportCollection) Generate() []byte
func (*ImportCollection) Method ¶
func (c *ImportCollection) Method() string
func (*ImportCollection) Path ¶
func (c *ImportCollection) Path() string
type ListCollections ¶
type ListCollections struct {
// contains filtered or unexported fields
}
ListCollections lists all collections from the current DB
func (*ListCollections) Description ¶
func (c *ListCollections) Description() string
func (*ListCollections) Generate ¶
func (c *ListCollections) Generate() []byte
func (*ListCollections) Method ¶
func (c *ListCollections) Method() string
func (*ListCollections) Path ¶
func (c *ListCollections) Path() string
type ListGraphs ¶
type ListGraphs struct{}
ListGraph lists all graphs known by the graph module.
func (*ListGraphs) Description ¶
func (l *ListGraphs) Description() string
func (*ListGraphs) Generate ¶
func (l *ListGraphs) Generate() []byte
func (*ListGraphs) Method ¶
func (l *ListGraphs) Method() string
func (*ListGraphs) Path ¶
func (l *ListGraphs) Path() string
type PersistentIndex ¶
type PersistentIndex struct {
BaseIndex
}
PersistentIndex -
func (*PersistentIndex) Description ¶
func (p *PersistentIndex) Description() string
func (*PersistentIndex) Generate ¶
func (p *PersistentIndex) Generate() []byte
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents an AQL query.
func (*Query) Bind ¶
Bind sets the name and value of a bind parameter Binding parameters prevents AQL injection
func (*Query) Cache ¶
Cache enables/disables the caching of the query. Unavailable prior to ArangoDB 2.7
func (*Query) Description ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result defines a query result, allowing the user to retrieve asynchronously every batch returned by the database.
type Runnable ¶
type Runnable interface { Description() string // Description shown in the logger Generate() []byte // The body of the request Path() string // The path where to send the request Method() string // The HTTP method to use }
Runnable defines requests runnable by the Run and RunAsync methods. Queries, transactions and everything in the requests.go file are Runnable.
type SetCacheProperties ¶
type SetCacheProperties struct { Mode string `json:"mode,omitempty"` MaxResults int `json:"maxResults,omitempty"` }
SetCacheProperties sets the query cache properties.
func (*SetCacheProperties) Description ¶
func (r *SetCacheProperties) Description() string
func (*SetCacheProperties) Generate ¶
func (r *SetCacheProperties) Generate() []byte
func (*SetCacheProperties) Method ¶
func (r *SetCacheProperties) Method() string
func (*SetCacheProperties) Path ¶
func (r *SetCacheProperties) Path() string
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represents an ArangoDB transaction.
func NewTransaction ¶
func NewTransaction(readCol, writeCol []string) *Transaction
NewTransaction returns a new Transaction object.
func (*Transaction) AddQuery ¶
func (t *Transaction) AddQuery(resultVar, aql string, params ...interface{}) *Transaction
AddQuery adds a new AQL query to the transaction. The result will be set in a temp variable named after the value of "resultVar". To use it from elsewhere in the transaction, use the Go templating convention.
e.g. NewTransaction([]string{}, []string{}).
AddQuery("var1", "FOR d IN documents RETURN d"). AddQuery("var2", "FOR d IN {{.var1}} RETURN d._id").Run(db)
func (*Transaction) Bind ¶
func (t *Transaction) Bind(name string, value interface{}) *Transaction
Bind sets the name and value of a bind parameter Binding parameters prevents AQL injection Example: transaction := arangolite.NewTransaction([]string{}, []string{}).
AddQuery("var1", "FOR d IN nodes FILTER d._key == @key RETURN d._id"). AddQuery("var2", "FOR n IN nodes FILTER n._id == {{.var1}}[0] RETURN n._key").Return("var2")
transaction.Bind("key", 123)
func (*Transaction) Description ¶
func (t *Transaction) Description() string
func (*Transaction) Generate ¶
func (t *Transaction) Generate() []byte
func (*Transaction) Method ¶
func (t *Transaction) Method() string
func (*Transaction) Path ¶
func (t *Transaction) Path() string
func (*Transaction) Return ¶
func (t *Transaction) Return(resultVar string) *Transaction
Return sets the final "resultVar" that is returned at the end of the transaction.
type TruncateCollection ¶
type TruncateCollection struct {
Name string
}
TruncateCollection deletes a collection in database.
func (*TruncateCollection) Description ¶
func (r *TruncateCollection) Description() string
func (*TruncateCollection) Generate ¶
func (r *TruncateCollection) Generate() []byte
func (*TruncateCollection) Method ¶
func (r *TruncateCollection) Method() string
func (*TruncateCollection) Path ¶
func (r *TruncateCollection) Path() string