ravendb-go-client: github.com/ravendb/ravendb-go-client Index | Files | Directories

package ravendb

import "github.com/ravendb/ravendb-go-client"

Package ravendb implements a driver for RavenDB NOSQL document database.

For more documentation see https://github.com/ravendb/ravendb-go-client/blob/master/readme.md

Index

Package Files

abstract_document_query.go abstract_index_creation_task.go advanced_session_extention_base.go advanced_session_operations.go after_save_changes_event_args.go aggregation_document_query.go aggregation_query_base.go aggresive_cache_options.go atomic_bool.go atomic_integer.go attachment_details.go attachment_name.go attachment_result.go attachment_type.go batch_command.go batch_operation.go batch_options.go before_delete_event_args.go before_query_event_args.go before_store_event_args.go bulk_insert_aborted_exception.go bulk_insert_operation.go character.go circle_criteria.go class_utils.go clean_closeable.go client_configuration.go close_subclause_token.go cluster_topology.go cluster_topology_response.go cmp_x_chg.go collection_statistics.go command_type.go compact_database_operation.go compact_settings.go compare_exchange_result.go compare_exchange_value.go compare_exchange_value_result_parser.go completable_future.go configure_revisions_operation.go conflict_solver.go connection_string.go connection_string_type.go constants.go copier.go create_database_operation.go create_sample_data_operation.go create_subscription_command.go create_subscription_result.go current_index_and_node.go database_changes.go database_promotion_status.go database_put_result.go database_record.go database_record_with_etag.go database_statistics.go database_topology.go declare_token.go delete_attachment_command_data.go delete_attachment_operation.go delete_by_query_operation.go delete_command_data.go delete_compare_exchange_value_operation.go delete_database_operation.go delete_database_result.go delete_document_command.go delete_index_operation.go delete_subscription_command.go disable_index_operation.go distinct_token.go doc.go document_change.go document_change_types.go document_conflict_exception.go document_conventions.go document_info.go document_query.go document_query_customization.go document_query_helper.go document_session.go document_session_attachments.go document_session_attachments_base.go document_session_revisions.go document_store.go document_subscriptions.go documents_by_id.go documents_changes.go drop_subscription_connection_command.go duration.go dynamic_spatial_field.go enable_index_operation.go entity_to_json.go errors.go event_handler.go evict_items_from_cache_based_on_changes.go exception_dispatcher.go exceptions_utils.go explain_query_command.go external_replication.go facet.go facet_aggregation.go facet_base.go facet_builder.go facet_options.go facet_result.go facet_setup.go facet_term_sort_mode.go facet_token.go facet_value.go field_indexing.go field_storage.go field_term_vector.go fields_to_fetch_token.go from_token.go generate_entity_id_on_the_client.go generate_id.go generic_query_result.go generic_range_facet.go get_attachment_operation.go get_client_configuration_operation.go get_cluster_topology_command.go get_collection_statistics_operation.go get_compare_exchange_value_operation.go get_compare_exchange_values_operation.go get_conflicts_command.go get_conflicts_result.go get_database_names_operation.go get_database_record_operation.go get_database_topology_command.go get_documents_command.go get_documents_result.go get_identities_operation.go get_index_errors_operation.go get_index_names_operation.go get_index_operation.go get_index_statistics_operation.go get_indexes_operation.go get_indexes_statistics_operation.go get_indexing_status_operation.go get_next_operation_id_command.go get_operation_state_operation.go get_request.go get_response.go get_revision_operation.go get_revisions_bin_entry_command.go get_revisions_command.go get_server_wide_operation_state_operation.go get_statistics_operation.go get_subscription_state_command.go get_subscriptions_command.go get_subscriptions_result.go get_tcp_info_command.go get_terms_operation.go group_by.go group_by_count_token.go group_by_document_query.go group_by_field.go group_by_key_token.go group_by_method.go group_by_sum_token.go group_by_token.go hash_calculator.go head_attachment_command.go head_document_command.go hi_lo_id_generator.go hi_lo_result.go hi_lo_return_command.go http.go http_cache.go http_cache_item.go http_extensions.go i_command_data.go i_lazy_operation.go i_maintenance_operation.go i_more_like_this_builder_base.go i_more_like_this_builder_for_document_query.go i_more_like_this_operations.go i_operation.go i_server_operation.go id_type_and_name.go in_memory_document_session_operations.go includes_util.go index_change.go index_change_types.go index_configuration.go index_creation.go index_definition.go index_definition_builder.go index_errors.go index_field_options.go index_has_changed_operation.go index_information.go index_lock_mode.go index_priority.go index_query.go index_query_base.go index_query_content.go index_query_with_parameters.go index_running_status.go index_state.go index_stats.go index_type.go indexing_error.go indexing_status.go inflect.go intersect_marker_token.go java_script_array.go json_array_result.go json_extensions.go json_operation.go json_util.go kill_operation_command.go lazy.go lazy_aggregation_query_operation.go lazy_load_operation.go lazy_multi_loader_with_include.go lazy_query_operation.go lazy_session_operations.go lazy_starts_with_operation.go lazy_suggestion_query_operation.go leader_stamp.go load_operation.go load_starting_with_operation.go load_token.go maintenance_operation_executor.go map_util.go metadata_as_dictionary.go method_call.go modify_ongoing_task_result.go more_like_this_base.go more_like_this_builder.go more_like_this_options.go more_like_this_query_result.go more_like_this_scope.go more_like_this_stop_words.go more_like_this_token.go more_like_this_using_any_document.go more_like_this_using_document.go more_like_this_using_document_for_document_query.go multi_database_hi_lo_id_generator.go multi_get_command.go multi_get_operation.go multi_loader_with_include.go multi_type_hi_lo_id_generator.go negate_token.go next_hi_lo_command.go next_identity_for_command.go node_id.go node_selector.go object_set.go open_subclause_token.go operation.go operation_exception_result.go operation_executor.go operation_id_result.go operation_status_change.go order_by_token.go ordering_type.go parameters.go patch_by_query_operation.go patch_command_data.go patch_operation.go patch_request.go patch_result.go patch_status.go point_field.go put_attachment_command_data.go put_attachment_operation.go put_client_configuration_operation.go put_command_data_with_json.go put_compare_exchange_value_operation.go put_connection_string_operation.go put_connection_string_result.go put_document_command.go put_index_result.go put_indexes_operation.go put_indexes_response.go put_result.go query_command.go query_data.go query_field_util.go query_operation.go query_operation_options.go query_operator.go query_operator_token.go query_result.go query_result_base.go query_statistics.go query_stream_command.go query_token.go range_builder.go range_facet.go raven_command.go raven_command_response_type.go raven_connection_string.go raw_document_query.go read_balance_behavior.go reflect.go replication_node.go request_executor.go requests_helpers.go reset_index_operation.go response_dispose_handling.go response_time_information.go revision.go revisions_collection_configuration.go revisions_configuration.go script_resolver.go search_operator.go seed_identity_for_command.go semaphore.go server_node.go server_operation_executor.go server_wide_operation.go session_created_event_args.go session_info.go session_options.go set_indexes_lock_operation.go set_indexes_priority_operation.go shape_token.go size.go spatial_criteria.go spatial_criteria_factory.go spatial_field_type.go spatial_options.go spatial_options_factory.go spatial_relation.go spatial_search_strategy.go spatial_units.go start_index_operation.go start_indexing_operation.go starts_with_args.go stop_index_operation.go stop_indexing_operation.go stream_command.go stream_operation.go stream_query_statistics.go stream_result.go stream_result_response.go string_array.go string_distance_types.go string_utils.go subscription_batch.go subscription_connection_client_message.go subscription_connection_server_message.go subscription_creation_options.go subscription_opening_strategy.go subscription_state.go subscription_state_with_node_details.go subscription_tryout.go subscription_worker.go subscription_worker_options.go suggest_token.go suggestion_base.go suggestion_builder.go suggestion_document_query.go suggestion_options.go suggestion_query_base.go suggestion_result.go suggestion_sort_mode.go suggestion_with_term.go suggestion_with_terms.go tcp_connection_header_message.go tcp_connection_header_response.go tcp_connection_info.go tcp_connection_status.go tcp_negotiate_parameters.go tcp_negotiation.go tcp_utils.go terms_query_result.go time.go time_utils.go topology.go true_token.go update_external_replication_operation.go url_utils.go util.go uuid.go where_operator.go where_params.go where_token.go wkt_criteria.go wkt_field.go

Constants

const (
    AttachmentDocument = "Document"
    AttachmentRevision = "Revision"
)
const (
    //CommandNone                = "NONE"
    CommandPut                 = "PUT"
    CommandPatch               = "PATCH"
    CommandDelete              = "DELETE"
    CommandAttachmentPut       = "ATTACHMENT_PUT"
    CommandAttachmentDelete    = "ATTACHMENT_DELETE"
    CommandClientAnyCommand    = "CLIENT_ANY_COMMAND"
    CommandClientNotAttachment = "CLIENT_NOT_ATTACHMENT"
)

Note: this is enum in Java but those are serialized to json as strings so making them strings is better in Go

const (
    ConnectionStringTypeNone  = "None"
    ConnectionStringTypeRaven = "Raven"
    ConnectionStringTypeSQL   = "Sql"
)
const (
    // Name of struct field that represents identity property
    IdentityProperty = "ID"

    MetadataCollection             = "@collection"
    MetadataProjection             = "@projection"
    MetadataKey                    = "@metadata"
    MetadataID                     = "@id"
    MetadataConflict               = "@conflict"
    MetadataIDProperty             = "Id"
    MetadataFlags                  = "@flags"
    MetadataAttachments            = "@attachments"
    MetadataInddexScore            = "@index-score"
    MetadataLastModified           = "@last-modified"
    MetadataRavenGoType            = "Raven-Go-Type"
    MetadataChangeVector           = "@change-vector"
    MetadataExpires                = "@expires"
    MetadataAllDocumentsCollection = "@all_docs"

    IndexingSideBySideIndexNamePrefix = "ReplacementOf/"
    IndexingFieldNameDocumentID       = "id()"
    IndexingFieldNameReduceKeyHash    = "hash(key())"
    IndexingFieldNameReduceKeyValue   = "key()"
    IndexingFieldAllFields            = "__all_fields"
    IndexingFieldsNameSpatialShare    = "spatial(shape)"
    //TBD CUSTOM_SORT_FIELD_NAME = "__customSort";
    IndexingSpatialDefaultDistnaceErrorPct = 0.025
)
const (
    DatabasePromotionStatusWaitingForFirstPromotion = "WaitingForFirstPromotion"
    DatabasePromotionStatusNotResponding            = "NotResponding"
    DatabasePromotionStatusIndexNotUpToDate         = "IndexNotUpToDate"
    DatabasePromotionStatusChangeVectorNotMerged    = "ChangeVectorNotMerged"
    DatabasePromotionStatusWaitingForResponse       = "WaitingForResponse"
    DatabasePromotionStatusOk                       = "Ok"
)
const (
    DocumentChangeNone     = "None"
    DocumentChangePut      = "Put"
    DocumentChangeDelete   = "Delete"
    DocumentChangeConflict = "Conflict"
    DocumentChangeCommon   = "Common"
)
const (
    FacetAggregationNone    = "None"
    FacetAggregationMax     = "Max"
    FacetAggregationMin     = "Min"
    FacetAggregationAverage = "Average"
    FacetAggregationSum     = "Sum"
)
const (
    FacetTermSortModeValueAsc  = "ValueAsc"
    FacetTermSortModeValueDesc = "ValueDesc"
    FacetTermSortModeCountAsc  = "CountAsc"
    FacetTermSortModeCountDesc = "CountDesc"
)
const (
    FieldIndexingNo      = "No"
    FieldIndexingSearch  = "Search"
    FieldIndexingExact   = "Exact"
    FieldIndexingDefault = "Default"
)
const (
    FieldStorageYes = "Yes"
    FieldStorageNo  = "No"
)
const (
    FieldTermVectorNo                      = "No"
    FieldTermVectorYes                     = "Yes"
    FieldTermVectorWithPositions           = "WithPositions"
    FieldTermVectorWithOffsets             = "WithOffsets"
    FieldTermVectorWithPositionsAndOffsets = "WithPositionsAndOffsets"
)
const (
    GroupByMethodNone  = "None"
    GroupByMethodArray = "Array"
)
const (
    IndexChangeNone                   = "None"
    IndexChangeBatchCompleted         = "BatchCompleted"
    IndexChangeIndexAdded             = "IndexAdded"
    IndexChangeIndexRemoved           = "IndexRemoved"
    IndexChangeIndexDemotedToIdle     = "IndexDemotedToIdle"
    IndexChangeIndexPromotedFromIdle  = "IndexPromotedFromIdle"
    IndexChangeIndexDemotedToDisabled = "IndexDemotedToDisabled"
    IndexChangeIndexMarkedAsErrored   = "IndexMarkedAsErrored"
    IndexChangeSideBySideReplace      = "SideBySideReplace"
    IndexChangeRenamed                = "Renamed"
    IndexChangeIndexPaused            = "IndexPaused"
    IndexChangeLockModeChanged        = "LockModeChanged"
    IndexChangePriorityChanged        = "PriorityChanged"
)
const (
    IndexLockModeUnlock       = "Unlock"
    IndexLockModeLockedIgnore = "LockedIgnore"
    IndexLockModeLockedError  = "LockedError"
)
const (
    IndexPriorityLow    = "Low"
    IndexPriorityNormal = "Normal"
    IndexPriorityHigh   = "High"
)
const (
    IndexRunningStatusRunning  = "Running"
    IndexRunningStatusPaused   = "Paused"
    IndexRunningStatusDisabled = "Disabled"
)
const (
    IndexStateNormal   = "Normal"
    IndexStateDisabled = "Disabled"
    IndexStateIdle     = "Idle"
    IndexStateError    = "Error"
)
const (
    IndexTypeNone          = "None"
    IndexTypeAutoMap       = "AutoMap"
    IndexTypeAutoMapReduce = "AutoMapReduce"
    IndexTypeMap           = "Map"
    IndexTypeMapReduce     = "MapReduce"
    IndexTypeFaulty        = "Faulty"
)
const (
    MoreLikeThisOptionsDefaultMaximumNumberOfTokensParsed = 5000
    MoreLikeThisOptionsDefaultMinimumTermFrequency        = 2
    MoreLikeThisOptionsDefaultMinimumDocumentFrequency    = 5
    MoreLikeThisOptionsDefaultMaximumDocumentFrequence    = math.MaxInt32
    MoreLikeThisOptionsDefaultBoost                       = false
    MoreLikeThisOptionsDefaultBoostFactor                 = 1
    MoreLikeThisOptionsDefaultMinimumWordLength           = 0
    MoreLikeThisOptionsDefaultMaximumWordLength           = 0
    MoreLikeThisOptionsDefaultMaximumQueryTerms           = 25
)
const (
    OrderingTypeString       = "STRING"
    OrderingTypeLong         = "LONG"
    OrderingTypeDouble       = "DOUBLE"
    OrderingTypeAlphaNumeric = "ALPHA_NUMERIC"
)
const (
    PatchStatusDocumentDoesNotExist = "DocumentDoesNotExist"
    PatchStatusCreated              = "Created"
    PatchStatusPatched              = "Patched"
    PatchStatusSkipped              = "Skipped"
    PatchStatusNotModified          = "NotModified"
)
const (
    RavenCommandResponseTypeEmpty  = "EMPTY"
    RavenCommandResponseTypeObject = "OBJECT"
    RavenCommandResponseTypeRaw    = "RAW"
)
const (
    ReadBalanceBehaviorNone        = "None"
    ReadBalanceBehaviorRoundRobin  = "RoundRobin"
    ReadBalanceBehaviorFastestNode = "FastestNode"
)
const (
    ServerNodeRoleNone       = "None"
    ServerNodeRolePromotable = "Promotable"
    ServerNodeRoleMember     = "Member"
    ServerNodeRoleRehab      = "Rehab"
)
const (
    SpatialFieldGeography = "Geography"
    SpatialFieldCartesian = "Cartesian"
)
const (
    //about 4.78 meters at equator, should be good enough (see: http://unterbahn.com/2009/11/metric-dimensions-of-geohash-partitions-at-the-equator/)
    SpatialOptionsDefaultGeohashLevel = 9
    //about 4.78 meters at equator, should be good enough
    SpatialOptionsDefaultQuadTreeLevel = 23
)
const (
    SpatialRelationWithin     = "Within"
    SpatialRelationContains   = "Contains"
    SpatialRelationDisjoin    = "Disjoint"
    SpatialRelationIntersects = "Intersects"
)
const (
    SpatialSearchStrategyGeohashPrefixTree = "GeohashPrefixTree"
    SpatialSearchStrategyQuadPrefixTree    = "QuadPrefixTree"
    SpatialSearchStrategyBoundingBox       = "BoundingBox"
)
const (
    SpatialUnitsKilometers = "Kilometers"
    SpatialUnitsMiles      = "Miles"
)
const (
    StringDistanceNone        = "None"
    StringDistanceDefault     = "Default"
    StringDistanceLevenshtein = "Levenshtein"
    StringDistanceJaroWinkler = "JaroWinkler"
    StringDistanceNGram       = "NGram"
)
const (
    SubscriptionClientMessageNone                 = "None"
    SubscriptionClientMessageAcknowledge          = "Acknowledge"
    SubscriptionClientMessageDisposedNotification = "DisposedNotification"
)
const (
    SubscriptionServerMessageNone             = "None"
    SubscriptionServerMessageConnectionStatus = "ConnectionStatus"
    SubscriptionServerMessageEndOfBatch       = "EndOfBatch"
    SubscriptionServerMessageData             = "Data"
    SubscriptionServerMessageConfirm          = "Confirm"
    SubscriptionServerMessageError            = "Error"
)
const (
    SubscriptionConnectionStatusNone                 = "None"
    SubscriptionConnectionStatusAccepted             = "Accepted"
    SubscriptionConnectionStatusInUse                = "InUse"
    SubscriptionConnectionStatusClosed               = "Closed"
    SubscriptionConnectionStatusNotFound             = "NotFound"
    SubscriptionConnectionStatusRedirect             = "Redirect"
    SubscriptionConnectionStatusForbiddenReadOnly    = "ForbiddenReadOnly"
    SubscriptionConnectionStatusForbidden            = "Forbidden"
    SubscriptionConnectionStatusInvalid              = "Invalid"
    SubscriptionConnectionStatusConcurrencyReconnect = "ConcurrencyReconnect"
)
const (
    // SubscriptionOpeningStrategyOpenIfFree:
    // The client will successfully open a subscription only if there isn't any other currently connected client.
    // Otherwise it will end up with SubscriptionInUseError
    SubscriptionOpeningStrategyOpenIfFree = "OpenIfFree"
    // SubscriptionOpeningStrategyTakeOver:
    // The connecting client will successfully open a subscription even if there is another active subscription's consumer.
    // If the new client takes over an existing client then the existing one will get a SubscriptionInUseException.
    //
    // The subscription will always be held by the last connected client.
    SubscriptionOpeningStrategyTakeOver = "TakeOver"
    // SubscriptionOpeningStrategyWaitForFree:
    // If the client currently cannot open the subscription because it is used by another client but it will wait for that client
    // to complete and keep attempting to gain the subscription
    SubscriptionOpeningStrategyWaitForFree = "WaitForFree"
)
const (
    SuggestionSortModeNone       = "None"
    SuggestionSortModePopularity = "Popularity"
)
const (
    MethodsTypeCmpXChg = "CmpXChg"
)

Variables

var (

    // HTTPClientPostProcessor allows to tweak http client after it has been created
    // this allows replacing Transport with a custom transport that does logging,
    // proxying or tweaks each http request
    HTTPClientPostProcessor func(*http.Client)

    // if true, adds lots of logging to track bugs in request executor
    DebugLogRequestExecutor bool = false
)
var (
    SuggestionOptionsDefaultOptions  = NewSuggestionOptions()
    SuggestionOptionsDefaultAccuracy = float32(0.5)
    SuggestionOptionsDefaultPageSize = 15
    SuggestionOptionsDefaultDistance = StringDistanceLevenshtein
    SuggestionOptionsDefaultSortMode = SuggestionSortModePopularity
)
var (
    // DefaultFacetOptions are default facet options
    DefaultFacetOptions = &FacetOptions{}
)
var (
    // if true, does verbose logging.
    LogVerbose = false
)

func FieldsFor Uses

func FieldsFor(s interface{}) []string

FieldsFor returns names of all fields for the value of a struct type. They can be used in e.g. DocumentQuery.SelectFields: fields := ravendb.FieldsFor(&MyType{}) q = q.SelectFields(fields...)

func GetCollectionNameDefault Uses

func GetCollectionNameDefault(entityOrType interface{}) string

GetCollectionNameDefault is a default way of

func IsPlural Uses

func IsPlural(word string) bool

IsPlural retruns true if word is plural

func IsSingular Uses

func IsSingular(word string) bool

IsSingular returns true if a word is singular

func ParseTime Uses

func ParseTime(s string) (time.Time, error)

ParseTime parses string time value returned by RavenDB server The value can't be parsed with a single string format

func Pluralize Uses

func Pluralize(word string, count int, inclusive bool) string

Pluralize or singularize a word based on the passed in count.

func RoundToServerTime Uses

func RoundToServerTime(t time.Time) time.Time

RoundToServerTime rounds t to the same precision as round-tripping to the server and back. Useful for comparing time.Time values for equality with values returned by the server

func ToPlural Uses

func ToPlural(word string) string

ToPlural makes a pluralized version of a word

func ToSingular Uses

func ToSingular(word string) string

ToSingular singularizes a word.

type AdvancedSessionExtensionBase Uses

type AdvancedSessionExtensionBase struct {
    // contains filtered or unexported fields
}

AdvancedSessionExtensionBase implements common advanced session operations

func (*AdvancedSessionExtensionBase) Defer Uses

func (e *AdvancedSessionExtensionBase) Defer(commands ...ICommandData)

Defer defers multiple commands to be executed on SaveChnages

type AdvancedSessionOperations Uses

type AdvancedSessionOperations struct {
    // contains filtered or unexported fields
}

AdvancedSessionOperations exposes advanced session operations

func (*AdvancedSessionOperations) AddAfterSaveChangesListener Uses

func (o *AdvancedSessionOperations) AddAfterSaveChangesListener(handler func(*AfterSaveChangesEventArgs)) int

func (*AdvancedSessionOperations) AddBeforeDeleteListener Uses

func (o *AdvancedSessionOperations) AddBeforeDeleteListener(handler func(*BeforeDeleteEventArgs)) int

func (*AdvancedSessionOperations) AddBeforeQueryListener Uses

func (o *AdvancedSessionOperations) AddBeforeQueryListener(handler func(*BeforeQueryEventArgs)) int

func (*AdvancedSessionOperations) AddBeforeStoreListener Uses

func (o *AdvancedSessionOperations) AddBeforeStoreListener(handler func(*BeforeStoreEventArgs)) int

func (*AdvancedSessionOperations) Attachments Uses

func (o *AdvancedSessionOperations) Attachments() *AttachmentsSessionOperations

func (*AdvancedSessionOperations) Clear Uses

func (o *AdvancedSessionOperations) Clear()

func (*AdvancedSessionOperations) Defer Uses

func (o *AdvancedSessionOperations) Defer(commands ...ICommandData)

func (*AdvancedSessionOperations) Eagerly Uses

func (o *AdvancedSessionOperations) Eagerly() *EagerSessionOperations

func (*AdvancedSessionOperations) Evict Uses

func (o *AdvancedSessionOperations) Evict(entity interface{}) error

func (*AdvancedSessionOperations) Exists Uses

func (o *AdvancedSessionOperations) Exists(id string) (bool, error)

func (*AdvancedSessionOperations) GetChangeVectorFor Uses

func (o *AdvancedSessionOperations) GetChangeVectorFor(instance interface{}) (*string, error)

func (*AdvancedSessionOperations) GetCurrentSessionNode Uses

func (o *AdvancedSessionOperations) GetCurrentSessionNode() (*ServerNode, error)

func (*AdvancedSessionOperations) GetDocumentID Uses

func (o *AdvancedSessionOperations) GetDocumentID(instance interface{}) string

func (*AdvancedSessionOperations) GetDocumentStore Uses

func (o *AdvancedSessionOperations) GetDocumentStore() *DocumentStore

func (*AdvancedSessionOperations) GetLastModifiedFor Uses

func (o *AdvancedSessionOperations) GetLastModifiedFor(instance interface{}) (*time.Time, error)

func (*AdvancedSessionOperations) GetMaxNumberOfRequestsPerSession Uses

func (o *AdvancedSessionOperations) GetMaxNumberOfRequestsPerSession() int

func (*AdvancedSessionOperations) GetMetadataFor Uses

func (o *AdvancedSessionOperations) GetMetadataFor(instance interface{}) (*MetadataAsDictionary, error)

func (*AdvancedSessionOperations) GetNumberOfRequests Uses

func (o *AdvancedSessionOperations) GetNumberOfRequests() int

GetNumberOfRequests returns number of requests sent to the server

func (*AdvancedSessionOperations) GetRequestExecutor Uses

func (o *AdvancedSessionOperations) GetRequestExecutor() *RequestExecutor

func (*AdvancedSessionOperations) HasChanged Uses

func (o *AdvancedSessionOperations) HasChanged(entity interface{}) (bool, error)

func (*AdvancedSessionOperations) HasChanges Uses

func (o *AdvancedSessionOperations) HasChanges() bool

func (*AdvancedSessionOperations) IgnoreChangesFor Uses

func (o *AdvancedSessionOperations) IgnoreChangesFor(entity interface{}) error

func (*AdvancedSessionOperations) Increment Uses

func (o *AdvancedSessionOperations) Increment(entity interface{}, path string, valueToAdd interface{}) error

func (*AdvancedSessionOperations) IncrementByID Uses

func (o *AdvancedSessionOperations) IncrementByID(id string, path string, valueToAdd interface{}) error

func (*AdvancedSessionOperations) IsLoaded Uses

func (o *AdvancedSessionOperations) IsLoaded(id string) bool

func (*AdvancedSessionOperations) Lazily Uses

func (o *AdvancedSessionOperations) Lazily() *LazySessionOperations

func (*AdvancedSessionOperations) LoadIntoStream Uses

func (o *AdvancedSessionOperations) LoadIntoStream(ids []string, output io.Writer) error

func (*AdvancedSessionOperations) LoadStartingWith Uses

func (o *AdvancedSessionOperations) LoadStartingWith(results interface{}, args *StartsWithArgs) error

func (*AdvancedSessionOperations) LoadStartingWithIntoStream Uses

func (o *AdvancedSessionOperations) LoadStartingWithIntoStream(output io.Writer, args *StartsWithArgs) error

func (*AdvancedSessionOperations) Patch Uses

func (o *AdvancedSessionOperations) Patch(entity interface{}, path string, value interface{}) error

func (*AdvancedSessionOperations) PatchArray Uses

func (o *AdvancedSessionOperations) PatchArray(entity interface{}, pathToArray string, arrayAdder func(*JavaScriptArray)) error

func (*AdvancedSessionOperations) PatchArrayByID Uses

func (o *AdvancedSessionOperations) PatchArrayByID(id string, pathToArray string, arrayAdder func(*JavaScriptArray)) error

func (*AdvancedSessionOperations) PatchByID Uses

func (o *AdvancedSessionOperations) PatchByID(id string, path string, value interface{}) error

func (*AdvancedSessionOperations) Query Uses

func (o *AdvancedSessionOperations) Query(opts *DocumentQueryOptions) *DocumentQuery

func (*AdvancedSessionOperations) QueryCollection Uses

func (o *AdvancedSessionOperations) QueryCollection(collectionName string) *DocumentQuery

func (*AdvancedSessionOperations) QueryCollectionForType Uses

func (o *AdvancedSessionOperations) QueryCollectionForType(typ reflect.Type) *DocumentQuery

func (*AdvancedSessionOperations) QueryIndex Uses

func (o *AdvancedSessionOperations) QueryIndex(indexName string) *DocumentQuery

func (*AdvancedSessionOperations) RawQuery Uses

func (o *AdvancedSessionOperations) RawQuery(rawQuery string) *RawDocumentQuery

func (*AdvancedSessionOperations) Refresh Uses

func (o *AdvancedSessionOperations) Refresh(entity interface{}) error

func (*AdvancedSessionOperations) RemoveAfterSaveChangesListener Uses

func (o *AdvancedSessionOperations) RemoveAfterSaveChangesListener(handlerID int)

func (*AdvancedSessionOperations) RemoveBeforeDeleteListener Uses

func (o *AdvancedSessionOperations) RemoveBeforeDeleteListener(handlerID int)

func (*AdvancedSessionOperations) RemoveBeforeQueryListener Uses

func (o *AdvancedSessionOperations) RemoveBeforeQueryListener(handlerID int)

func (*AdvancedSessionOperations) RemoveBeforeStoreListener Uses

func (o *AdvancedSessionOperations) RemoveBeforeStoreListener(handlerID int)

func (*AdvancedSessionOperations) Revisions Uses

func (o *AdvancedSessionOperations) Revisions() *RevisionsSessionOperations

func (*AdvancedSessionOperations) SetMaxNumberOfRequestsPerSession Uses

func (o *AdvancedSessionOperations) SetMaxNumberOfRequestsPerSession(n int)

func (*AdvancedSessionOperations) Stream Uses

func (o *AdvancedSessionOperations) Stream(args *StartsWithArgs) (*StreamIterator, error)

func (*AdvancedSessionOperations) StreamQuery Uses

func (o *AdvancedSessionOperations) StreamQuery(query *DocumentQuery, streamQueryStats *StreamQueryStatistics) (*StreamIterator, error)

func (*AdvancedSessionOperations) StreamQueryInto Uses

func (o *AdvancedSessionOperations) StreamQueryInto(query *DocumentQuery, output io.Writer) error

func (*AdvancedSessionOperations) StreamRawQuery Uses

func (o *AdvancedSessionOperations) StreamRawQuery(query *RawDocumentQuery, streamQueryStats *StreamQueryStatistics) (*StreamIterator, error)

func (*AdvancedSessionOperations) StreamRawQueryInto Uses

func (o *AdvancedSessionOperations) StreamRawQueryInto(query *RawDocumentQuery, output io.Writer) error

func (*AdvancedSessionOperations) WaitForIndexesAfterSaveChanges Uses

func (o *AdvancedSessionOperations) WaitForIndexesAfterSaveChanges(options func(*IndexesWaitOptsBuilder))

func (*AdvancedSessionOperations) WaitForReplicationAfterSaveChanges Uses

func (o *AdvancedSessionOperations) WaitForReplicationAfterSaveChanges(options func(*ReplicationWaitOptsBuilder))

func (*AdvancedSessionOperations) WhatChanged Uses

func (o *AdvancedSessionOperations) WhatChanged() (map[string][]*DocumentsChanges, error)

type AfterSaveChangesEventArgs Uses

type AfterSaveChangesEventArgs struct {
    Session    *InMemoryDocumentSessionOperations
    DocumentID string
    Entity     interface{}
    // contains filtered or unexported fields
}

AfterSaveChangesEventArgs describes arguments for "after save changes" listener

func (*AfterSaveChangesEventArgs) GetDocumentMetadata Uses

func (a *AfterSaveChangesEventArgs) GetDocumentMetadata() *MetadataAsDictionary

GetDocumentMetadata returns metadata for the entity represented by this event

type AggregationDocumentQuery Uses

type AggregationDocumentQuery = aggregationQueryBase

Note: AggregationDocumentQuery is fused into AggregationQueryBase because in Java AggregationQueryBase calls functions implemented in AggregationDocumentQuery and that doesn't translate to Go's embedding

func (*AggregationDocumentQuery) AndAggregateByFacet Uses

func (q *AggregationDocumentQuery) AndAggregateByFacet(facet FacetBase) *AggregationDocumentQuery

from AggregationDocumentQuery

func (*AggregationDocumentQuery) GetIndexQuery Uses

func (q *AggregationDocumentQuery) GetIndexQuery() (*IndexQuery, error)

type AggressiveCacheOptions Uses

type AggressiveCacheOptions struct {
    Duration time.Duration
}

TODO: should this be exported?

type AllTopologyNodesDownError Uses

type AllTopologyNodesDownError struct {
    // contains filtered or unexported fields
}

AllTopologyNodesDownError represents "all topology nodes are down" error

func (*AllTopologyNodesDownError) Error Uses

func (e *AllTopologyNodesDownError) Error() string

Error makes it conform to error interface

type AttachmentDetails Uses

type AttachmentDetails struct {
    AttachmentName
    ChangeVector *string `json:"ChangeVector"`
    DocumentID   string  `json:"DocumentId"`
}

AttachmentDetails represents details of an attachment

type AttachmentName Uses

type AttachmentName struct {
    Name        string `json:"Name"`
    Hash        string `json:"Hash"`
    ContentType string `json:"ContentType"`
    Size        int64  `json:"Size"`
}

AttachmentName represents infor about an attachment

type AttachmentResult Uses

type AttachmentResult struct {
    Data    io.Reader
    Details *AttachmentDetails
    // contains filtered or unexported fields
}

AttachmentResult represents an attachment

func (*AttachmentResult) Close Uses

func (r *AttachmentResult) Close() error

Close closes the attachment

type AttachmentType Uses

type AttachmentType = string

type AttachmentsSessionOperations Uses

type AttachmentsSessionOperations = DocumentSessionAttachments

TODO: make a unique wrapper type

type AuthorizationError Uses

type AuthorizationError struct {
    // contains filtered or unexported fields
}

AuthorizationError represents authorization error

func (*AuthorizationError) Error Uses

func (e *AuthorizationError) Error() string

Error makes it conform to error interface

type BadRequestError Uses

type BadRequestError struct {
    URL      string `json:"Url"`
    Type     string `json:"Type"`
    Message  string `json:"Message"`
    ErrorStr string `json:"Error"`
}

BadRequestError maps to server's 400 Bad Request response This is additional information sent by the server

func (*BadRequestError) Error Uses

func (e *BadRequestError) Error() string

Error makes it conform to error interface

type BadResponseError Uses

type BadResponseError struct {
    // contains filtered or unexported fields
}

BadResponseError represents "bad response" error

func (*BadResponseError) Error Uses

func (e *BadResponseError) Error() string

Error makes it conform to error interface

type BatchCommand Uses

type BatchCommand struct {
    RavenCommandBase

    Result *JSONArrayResult
    // contains filtered or unexported fields
}

BatchCommand represents batch command

func (*BatchCommand) Close Uses

func (c *BatchCommand) Close() error

type BatchOperation Uses

type BatchOperation struct {
    // contains filtered or unexported fields
}

BatchOperation represents a batch operation

type BatchOptions Uses

type BatchOptions struct {
    // contains filtered or unexported fields
}

BatchOptions describes options for batch operations

func NewBatchOptions Uses

func NewBatchOptions() *BatchOptions

NewBatchOptions returns new BatchOptions

type BeforeDeleteEventArgs Uses

type BeforeDeleteEventArgs struct {
    Session    *InMemoryDocumentSessionOperations
    DocumentID string
    Entity     interface{}
    // contains filtered or unexported fields
}

BeforeDeleteEventArgs describes arguments for "before delete" listener

func (*BeforeDeleteEventArgs) GetDocumentMetadata Uses

func (a *BeforeDeleteEventArgs) GetDocumentMetadata() *MetadataAsDictionary

GetDocumentMetadata returns metadata for the entity being deleted

type BeforeQueryEventArgs Uses

type BeforeQueryEventArgs struct {
    Session            *InMemoryDocumentSessionOperations
    QueryCustomization *DocumentQueryCustomization
}

BeforeQueryEventArgs describes arguments for "before query" event

type BeforeStoreEventArgs Uses

type BeforeStoreEventArgs struct {
    Session    *InMemoryDocumentSessionOperations
    DocumentID string
    Entity     interface{}
    // contains filtered or unexported fields
}

BeforeStoreEventArgs describe arguments for "before store" listener

func (*BeforeStoreEventArgs) GetDocumentMetadata Uses

func (a *BeforeStoreEventArgs) GetDocumentMetadata() *MetadataAsDictionary

GetDocumentMetadata returns metadata for entity represented by this event

type BulkInsertAbortedError Uses

type BulkInsertAbortedError struct {
    RavenError
}

BulkInsertAbortedError represents "bulk insert aborted" error

func (*BulkInsertAbortedError) Error Uses

func (e *BulkInsertAbortedError) Error() string

Error makes it conform to error interface

type BulkInsertCommand Uses

type BulkInsertCommand struct {
    RavenCommandBase

    Result *http.Response
    // contains filtered or unexported fields
}

BulkInsertCommand describes build insert command

func NewBulkInsertCommand Uses

func NewBulkInsertCommand(id int64, stream io.Reader, useCompression bool) *BulkInsertCommand

NewBulkInsertCommand returns new BulkInsertCommand

type BulkInsertOperation Uses

type BulkInsertOperation struct {
    Command *BulkInsertCommand
    // contains filtered or unexported fields
}

BulkInsertOperation represents bulk insert operation

func NewBulkInsertOperation Uses

func NewBulkInsertOperation(database string, store *DocumentStore) *BulkInsertOperation

NewBulkInsertOperation returns new BulkInsertOperation

func (*BulkInsertOperation) Abort Uses

func (o *BulkInsertOperation) Abort() error

Abort aborts insert operation

func (*BulkInsertOperation) Close Uses

func (o *BulkInsertOperation) Close() error

Close closes operation

func (*BulkInsertOperation) GetID Uses

func (o *BulkInsertOperation) GetID(entity interface{}) (string, error)

GetID returns id for an entity

func (*BulkInsertOperation) Store Uses

func (o *BulkInsertOperation) Store(entity interface{}, metadata *MetadataAsDictionary) (string, error)

Store stores entity. metadata can be nil

func (*BulkInsertOperation) StoreWithID Uses

func (o *BulkInsertOperation) StoreWithID(entity interface{}, id string, metadata *MetadataAsDictionary) error

StoreWithID stores an entity with a given id

func (*BulkInsertOperation) WaitForID Uses

func (o *BulkInsertOperation) WaitForID() error

WaitForID waits for operation id to finish

type CancelFunc Uses

type CancelFunc func()

type CancellationError Uses

type CancellationError struct {
}

func (*CancellationError) Error Uses

func (e *CancellationError) Error() string

type CertificateNameMismatchError Uses

type CertificateNameMismatchError struct {
    // contains filtered or unexported fields
}

CertificateNameMismatchError is returned when subscription is in use

func (*CertificateNameMismatchError) Error Uses

func (e *CertificateNameMismatchError) Error() string

Error makes it conform to error interface

type ChangeType Uses

type ChangeType int

ChangeType describes a type of a change in a document

const (
    // TODO: make those into a string?
    DocumentChangeDocumentDeleted ChangeType = iota
    DocumentChangeDocumentAdded
    DocumentChangeFieldChanged
    DocumentChangeNewField
    DocumentChangeRemovedField
    DocumentChangeArrayValueChanged
    DocumentChangeArrayValueAdded
    DocumentChangeArrayValueRemoved
    DocumentChangeFieldTypeChanged
    DocumentChangeEntityTypeChanged
)

type CircleCriteria Uses

type CircleCriteria struct {
    SpatialCriteriaCommon
    // contains filtered or unexported fields
}

CircleCriteria describes circle criteria

func NewCircleCriteria Uses

func NewCircleCriteria(radius float64, latitude float64, longitude float64, radiusUnits SpatialUnits, relation SpatialRelation, distErrorPercent float64) *CircleCriteria

NewCircleCriteria returns new CircleCriteria

func (*CircleCriteria) GetShapeToken Uses

func (c *CircleCriteria) GetShapeToken(addQueryParameter func(interface{}) string) *shapeToken

GetShapeToken returns shapeToken

func (*CircleCriteria) ToQueryToken Uses

func (c *CircleCriteria) ToQueryToken(fieldName string, addQueryParameter func(interface{}) string) queryToken

ToQueryToken creates a token

type ClientConfiguration Uses

type ClientConfiguration struct {
    Etag       int64 `json:"Etag"`
    IsDisabled bool  `json:"Disabled"`
    // TODO: should this be *int ?
    MaxNumberOfRequestsPerSession int                 `json:"MaxNumberOfRequestsPerSession"`
    ReadBalanceBehavior           ReadBalanceBehavior `json:"ReadBalanceBehavior"`
}

ClientConfiguration represents client configuration

type ClientVersionMismatchError Uses

type ClientVersionMismatchError struct {
    // contains filtered or unexported fields
}

ClientVersionMismatchError is returned when subscription is in use

func (*ClientVersionMismatchError) Error Uses

func (e *ClientVersionMismatchError) Error() string

Error makes it conform to error interface

type ClusterRequestExecutor Uses

type ClusterRequestExecutor = RequestExecutor

Note: for simplicity ClusterRequestExecutor logic is implemented in RequestExecutor because Go doesn't support inheritance

type ClusterTopology Uses

type ClusterTopology struct {
    LastNodeID string `json:"LastNodeId"`
    TopologyID string `json:"TopologyId"`

    // Those map name like A to server url like http://localhost:9999
    Members     map[string]string `json:"Members"`
    Promotables map[string]string `json:"Promotables"`
    Watchers    map[string]string `json:"Watchers"`
}

ClusterTopology is a part of ClusterTopologyResponse TODO: should be private?

type ClusterTopologyResponse Uses

type ClusterTopologyResponse struct {
    Leader   string           `json:"Leader"`
    NodeTag  string           `json:"NodeTag"`
    Topology *ClusterTopology `json:"Topology"`
}

ClusterTopologyResponse is a response of GetClusterTopologyCommand

type CmpXchg Uses

type CmpXchg struct {
    MethodCallData
}

CmpXchg represents data for cmp xchg method

func CmpXchgValue Uses

func CmpXchgValue(key string) *CmpXchg

CmpXchgValue returns CmpXchg for a given key

type CollectionStatistics Uses

type CollectionStatistics struct {
    CountOfDocuments int            `json:"CountOfDocuments"`
    CountOfConflicts int            `json:"CountOfConflicts"`
    Collections      map[string]int `json:"Collections"`
}

CollectionStatistics describes collection statistics

type CollectionStats Uses

type CollectionStats struct {
    LastProcessedDocumentEtag  int64 `json:"LastProcessedDocumentEtag"`
    LastProcessedTombstoneEtag int64 `json:"LastProcessedTombstoneEtag"`
    DocumentLag                int64 `json:"DocumentLag"`
    TombstoneLag               int64 `json:"TombstoneLag"`
}

func NewCollectionStats Uses

func NewCollectionStats() *CollectionStats

type CommandData Uses

type CommandData struct {
    ID           string
    Name         string
    ChangeVector *string
    Type         CommandType
}

CommandData describes common data for commands

type CommandType Uses

type CommandType = string

using type alias for easy json serialization

type CompactDatabaseCommand Uses

type CompactDatabaseCommand struct {
    RavenCommandBase

    Result *OperationIDResult
    // contains filtered or unexported fields
}

CompactDatabaseCommand describes "compact database" command

func NewCompactDatabaseCommand Uses

func NewCompactDatabaseCommand(conventions *DocumentConventions, compactSettings *CompactSettings) (*CompactDatabaseCommand, error)

NewCompactDatabaseCommand returns new CompactDatabaseCommand

type CompactDatabaseOperation Uses

type CompactDatabaseOperation struct {
    Command *CompactDatabaseCommand
    // contains filtered or unexported fields
}

CompactDatabaseOperation describes "compact database" operation

func NewCompactDatabaseOperation Uses

func NewCompactDatabaseOperation(compactSettings *CompactSettings) *CompactDatabaseOperation

NewCompactDatabaseOperation returns new CompactDatabaseOperation

func (*CompactDatabaseOperation) GetCommand Uses

func (o *CompactDatabaseOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

GetCommand returns a command

type CompactSettings Uses

type CompactSettings struct {
    DatabaseName string   `json:"DatabaseName"`
    Documents    bool     `json:"Documents"`
    Indexes      []string `json:"Indexes,omitempty"`
}

CompactSettings is an argument to CompactDatabaseOperation

type CompareExchangeResult Uses

type CompareExchangeResult struct {
    Value        interface{}
    Index        int64
    IsSuccessful bool
}

CompareExchangeResult describes result of compare exchange

type CompareExchangeValue Uses

type CompareExchangeValue struct {
    Key   string
    Index int64
    Value interface{}
}

CompareExchangeValue represents value for compare exchange

func NewCompareExchangeValue Uses

func NewCompareExchangeValue(key string, index int64, value interface{}) *CompareExchangeValue

NewCompareExchangeValue returns new CompareExchangeValue

type ConcurrencyCheckMode Uses

type ConcurrencyCheckMode int

ConcurrencyCheckMode describes concurrency check

const (
    // ConcurrencyCheckAuto is automatic optimistic concurrency check depending on UseOptimisticConcurrency setting or provided Change Vector
    ConcurrencyCheckAuto ConcurrencyCheckMode = iota
    // ConcurrencyCheckForced forces optimistic concurrency check even if UseOptimisticConcurrency is not set
    ConcurrencyCheckForced
    // ConcurrencyCheckDisabled disables optimistic concurrency check even if UseOptimisticConcurrency is set
    ConcurrencyCheckDisabled
)

type ConcurrencyError Uses

type ConcurrencyError struct {
    RavenError

    ExpectedETag         int64
    ActualETag           int64
    ExpectedChangeVector string
    ActualChangeVector   string
}

ConcurrencyError represents concurrency error

func (*ConcurrencyError) Error Uses

func (e *ConcurrencyError) Error() string

Error makes it conform to error interface

type ConfigureRevisionsCommand Uses

type ConfigureRevisionsCommand struct {
    RavenCommandBase

    Result *ConfigureRevisionsOperationResult
    // contains filtered or unexported fields
}

ConfigureRevisionsCommand represents configure revisions command

func NewConfigureRevisionsCommand Uses

func NewConfigureRevisionsCommand(configuration *RevisionsConfiguration) *ConfigureRevisionsCommand

NewConfigureRevisionsCommand returns new ConfigureRevisionsCommand

type ConfigureRevisionsOperation Uses

type ConfigureRevisionsOperation struct {
    Command *ConfigureRevisionsCommand
    // contains filtered or unexported fields
}

ConfigureRevisionsOperation represents configure revisions operation

func NewConfigureRevisionsOperation Uses

func NewConfigureRevisionsOperation(configuration *RevisionsConfiguration) *ConfigureRevisionsOperation

NewConfigureRevisionsOperation returns new ConfigureRevisionsOperation

func (*ConfigureRevisionsOperation) GetCommand Uses

func (o *ConfigureRevisionsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

GetCommand returns new RavenCommand for this operation

type ConfigureRevisionsOperationResult Uses

type ConfigureRevisionsOperationResult struct {
    RaftCommandIndex int64 `json:"RaftCommandIndex"`
}

ConfigureRevisionsOperationResult represents result of configure revisions operation

type Conflict Uses

type Conflict struct {
    LastModified Time                   `json:"LastModified"`
    ChangeVector string                 `json:"ChangeVector"`
    Doc          map[string]interface{} `json:"Doc"`
}

Conflict represents conflict

type ConflictError Uses

type ConflictError struct {
    URL      string `json:"Url"`
    Type     string `json:"Type"`
    Message  string `json:"Message"`
    ErrorStr string `json:"Error"`
}

ConflictError maps to server's 409 Conflict response

func (*ConflictError) Error Uses

func (e *ConflictError) Error() string

Error makes it conform to error interface

type ConflictException Uses

type ConflictException struct {
    RavenError
}

func NewConflictException Uses

func NewConflictException(format string, args ...interface{}) *ConflictException

func (*ConflictException) Error Uses

func (e *ConflictException) Error() string

Error makes it conform to error interface

type ConflictSolver Uses

type ConflictSolver struct {
    ResolveByCollection map[string]*ScriptResolver `json:"ResolveByCollection"`
    ResolveToLatest     bool                       `json:"ResolveToLatest"`
}

ConflictSolver describes how to resolve conflicts

type ConnectionString Uses

type ConnectionString struct {
    Name string `json:"Name"`
    // Note: Java has this as a virtual function getType()
    Type ConnectionStringType `json:"Type"`
}

ConnectionString represents connection string used as argument to PutConnectionStringCommand

type ConnectionStringType Uses

type ConnectionStringType = string

TODO: only used in ConnectionString which is unused

type CreateDatabaseCommand Uses

type CreateDatabaseCommand struct {
    RavenCommandBase

    Result *DatabasePutResult
    // contains filtered or unexported fields
}

CreateDatabaseCommand represents "create database" command

func NewCreateDatabaseCommand Uses

func NewCreateDatabaseCommand(conventions *DocumentConventions, databaseRecord *DatabaseRecord, replicationFactor int) (*CreateDatabaseCommand, error)

NewCreateDatabaseCommand returns new CreateDatabaseCommand

type CreateDatabaseOperation Uses

type CreateDatabaseOperation struct {
    // contains filtered or unexported fields
}

CreateDatabaseOperation represents "create database" operation

func NewCreateDatabaseOperation Uses

func NewCreateDatabaseOperation(databaseRecord *DatabaseRecord, replicationFactor int) *CreateDatabaseOperation

NewCreateDatabaseOperation returns CreateDatabaseOperation

func (*CreateDatabaseOperation) GetCommand Uses

func (o *CreateDatabaseOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

GetCommand returns command for this operation

type CreateSampleDataCommand Uses

type CreateSampleDataCommand struct {
    RavenCommandBase
}

CreateSampleDataCommand represents command for creating sample data

func NewCreateSampleDataCommand Uses

func NewCreateSampleDataCommand(conventions *DocumentConventions) *CreateSampleDataCommand

NewCreateSampleDataCommand returns new CreateSampleDataCommand

type CreateSampleDataOperation Uses

type CreateSampleDataOperation struct {
    Command *CreateSampleDataCommand
}

CreateSampleDataOperation represents operation to create sample data

func NewCreateSampleDataOperation Uses

func NewCreateSampleDataOperation() *CreateSampleDataOperation

NewCreateSampleDataOperation

func (*CreateSampleDataOperation) GetCommand Uses

func (o *CreateSampleDataOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

GetCommand returns a comman

type CreateSubscriptionCommand Uses

type CreateSubscriptionCommand struct {
    RavenCommandBase

    Result *CreateSubscriptionResult
    // contains filtered or unexported fields
}

CreateSubscriptionCommand represents "create subscription" command

type CreateSubscriptionResult Uses

type CreateSubscriptionResult struct {
    Name string `json:"Name"`
}

CreateSubscriptionResult represents result for "create subscription" command

type CurrentIndexAndNode Uses

type CurrentIndexAndNode struct {
    // contains filtered or unexported fields
}

func NewCurrentIndexAndNode Uses

func NewCurrentIndexAndNode(currentIndex int, currentNode *ServerNode) *CurrentIndexAndNode

type DatabaseChanges Uses

type DatabaseChanges struct {
    // contains filtered or unexported fields
}

DatabaseChanges notifies about changes to a database

func (*DatabaseChanges) AddConnectionStatusChanged Uses

func (c *DatabaseChanges) AddConnectionStatusChanged(handler func()) int

func (*DatabaseChanges) AddOnError Uses

func (c *DatabaseChanges) AddOnError(handler func(error)) int

func (*DatabaseChanges) Close Uses

func (c *DatabaseChanges) Close()

Close closes DatabaseChanges and release its resources

func (*DatabaseChanges) EnsureConnectedNow Uses

func (c *DatabaseChanges) EnsureConnectedNow() error

func (*DatabaseChanges) ForAllDocuments Uses

func (c *DatabaseChanges) ForAllDocuments(cb func(*DocumentChange)) (CancelFunc, error)

ForAllDocuments registers a callback that will be called for changes on all documents. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForAllIndexes Uses

func (c *DatabaseChanges) ForAllIndexes(cb func(*IndexChange)) (CancelFunc, error)

ForAllIndexes registers a callback that will be called when a change on any index happens. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForAllOperations Uses

func (c *DatabaseChanges) ForAllOperations(cb func(change *OperationStatusChange)) (CancelFunc, error)

ForAllOperations registers a callback that will be called when any operation changes status. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForDocument Uses

func (c *DatabaseChanges) ForDocument(docID string, cb func(*DocumentChange)) (CancelFunc, error)

ForDocument registers a callback that will be called for changes on a ocument with a given id It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForDocumentsInCollection Uses

func (c *DatabaseChanges) ForDocumentsInCollection(collectionName string, cb func(*DocumentChange)) (CancelFunc, error)

ForDocumentsInCollection registers a callback that will be called on changes for documents in a given collection. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForDocumentsInCollectionOfType Uses

func (c *DatabaseChanges) ForDocumentsInCollectionOfType(clazz reflect.Type, cb func(*DocumentChange)) (CancelFunc, error)

ForDocumentsInCollectionOfType registers a callback that will be called on changes for documents of a given type. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForDocumentsStartingWith Uses

func (c *DatabaseChanges) ForDocumentsStartingWith(docIDPrefix string, cb func(*DocumentChange)) (CancelFunc, error)

ForDocumentsStartingWith registers a callback that will be called for changes on documents whose id starts with a given prefix. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForIndex Uses

func (c *DatabaseChanges) ForIndex(indexName string, cb func(*IndexChange)) (CancelFunc, error)

ForIndex registers a callback that will be called for changes in an index with a given name. It returns a function to call to unregister the callback.

func (*DatabaseChanges) ForOperationID Uses

func (c *DatabaseChanges) ForOperationID(operationID int64, cb func(*OperationStatusChange)) (CancelFunc, error)

ForOperationID registers a callback that will be called when a change happens to operation with a given id. It returns a function to call to unregister the callback.

func (*DatabaseChanges) RemoveConnectionStatusChanged Uses

func (c *DatabaseChanges) RemoveConnectionStatusChanged(handlerID int)

func (*DatabaseChanges) RemoveOnError Uses

func (c *DatabaseChanges) RemoveOnError(handlerID int)

type DatabaseDoesNotExistError Uses

type DatabaseDoesNotExistError struct {
    // contains filtered or unexported fields
}

DatabaseDoesNotExistError represents "database not not exist" error

func (*DatabaseDoesNotExistError) Error Uses

func (e *DatabaseDoesNotExistError) Error() string

Error makes it conform to error interface

type DatabasePromotionStatus Uses

type DatabasePromotionStatus = string

type DatabasePutResult Uses

type DatabasePutResult struct {
    RaftCommandIndex int64    `json:"RaftCommandIndex"`
    Name             string   `json:"Name"`
    DatabaseTopology Topology `json:"Topology"`
    NodesAddedTo     []string `json:"NodesAddedTo"`
}

DatabasePutResult describes server response for e.g. CreateDatabaseCommand

type DatabaseRecord Uses

type DatabaseRecord struct {
    DatabaseName         string            `json:"DatabaseName"`
    Disabled             bool              `json:"Disabled"`
    DataDirectory        string            `json:"DataDirectory,omitempty"`
    Settings             map[string]string `json:"Settings"`
    ConflictSolverConfig *ConflictSolver   `json:"ConflictSolverConfig"`
}

DatabaseRecord represents database record

func NewDatabaseRecord Uses

func NewDatabaseRecord() *DatabaseRecord

NewDatabaseRecord returns new database record

type DatabaseRecordWithEtag Uses

type DatabaseRecordWithEtag struct {
    DatabaseRecord
    Etag int64 `json:"Etag"`
}

DatabaseRecordWithEtag represents database record with etag

type DatabaseStatistics Uses

type DatabaseStatistics struct {
    LastDocEtag               int64 `json:"LastDocEtag"`
    CountOfIndexes            int   `json:"CountOfIndexes"`
    CountOfDocuments          int64 `json:"CountOfDocuments"`
    CountOfRevisionDocuments  int64 `json:"CountOfRevisionDocuments"` // TODO: present in Java, not seen in JSON
    CountOfDocumentsConflicts int64 `json:"CountOfDocumentsConflicts"`
    CountOfTombstones         int64 `json:"CountOfTombstones"`
    CountOfConflicts          int64 `json:"CountOfConflicts"`
    CountOfAttachments        int64 `json:"CountOfAttachments"`
    CountOfUniqueAttachments  int64 `json:"CountOfUniqueAttachments"`

    Indexes []*IndexInformation `json:"Indexes"`

    DatabaseChangeVector                     string `json:"DatabaseChangeVector"`
    DatabaseID                               string `json:"DatabaseId"`
    Is64Bit                                  bool   `json:"Is64Bit"`
    Pager                                    string `json:"Pager"`
    LastIndexingTime                         *Time  `json:"LastIndexingTime"`
    SizeOnDisk                               *Size  `json:"SizeOnDisk"`
    TempBuffersSizeOnDisk                    *Size  `json:"TempBuffersSizeOnDisk"`
    NumberOfTransactionMergerQueueOperations int    `json:"NumberOfTransactionMergerQueueOperations"`
}

DatabaseStatistics describes a result of GetStatisticsCommand

func (*DatabaseStatistics) GetLastIndexingTime Uses

func (s *DatabaseStatistics) GetLastIndexingTime() *time.Time

GetLastIndexingTime returns last indexing time

type DatabaseTopology Uses

type DatabaseTopology struct {
    Members                  []string          `json:"Members"`
    Promotables              []string          `json:"Promotables"`
    Rehabs                   []string          `json:"Rehabs"`
    PredefinedMentors        map[string]string `json:"PredefinedMentors"`
    DemotionReasons          map[string]string `json:"DemotionReasons"`
    PromotablesStatus        map[string]string `json:"PromotablesStatus"`
    ReplicationFactor        int               `json:"ReplicationFactor"`
    DynamicNodesDistribution bool              `json:"DynamicNodesDistribution"`
    Stamp                    LeaderStamp       `json:"Stamp"`
}

DatabaseTopology describes a topology of the database

type DeleteAttachmentCommand Uses

type DeleteAttachmentCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

func NewDeleteAttachmentCommand Uses

func NewDeleteAttachmentCommand(documentID string, name string, changeVector *string) (*DeleteAttachmentCommand, error)

type DeleteAttachmentCommandData Uses

type DeleteAttachmentCommandData struct {
    *CommandData
}

func NewDeleteAttachmentCommandData Uses

func NewDeleteAttachmentCommandData(documentID string, name string, changeVector *string) (*DeleteAttachmentCommandData, error)

NewDeleteAttachmentCommandData creates CommandData for Delete Attachment command

type DeleteAttachmentOperation Uses

type DeleteAttachmentOperation struct {
    Command *DeleteAttachmentCommand
    // contains filtered or unexported fields
}

func NewDeleteAttachmentOperation Uses

func NewDeleteAttachmentOperation(documentID string, name string, changeVector *string) *DeleteAttachmentOperation

func (*DeleteAttachmentOperation) GetCommand Uses

func (o *DeleteAttachmentOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type DeleteByIndexCommand Uses

type DeleteByIndexCommand struct {
    RavenCommandBase

    Result *OperationIDResult
    // contains filtered or unexported fields
}

func NewDeleteByIndexCommand Uses

func NewDeleteByIndexCommand(conventions *DocumentConventions, queryToDelete *IndexQuery, options *QueryOperationOptions) (*DeleteByIndexCommand, error)

type DeleteByQueryOperation Uses

type DeleteByQueryOperation struct {
    Command *DeleteByIndexCommand
    // contains filtered or unexported fields
}

func NewDeleteByQueryOperation Uses

func NewDeleteByQueryOperation(queryToDelete *IndexQuery, options *QueryOperationOptions) (*DeleteByQueryOperation, error)

func (*DeleteByQueryOperation) GetCommand Uses

func (o *DeleteByQueryOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type DeleteCommandData Uses

type DeleteCommandData struct {
    CommandData
}

DeleteCommandData represents data for delete command

type DeleteCompareExchangeValueOperation Uses

type DeleteCompareExchangeValueOperation struct {
    Command *RemoveCompareExchangeValueCommand
    // contains filtered or unexported fields
}

func NewDeleteCompareExchangeValueOperation Uses

func NewDeleteCompareExchangeValueOperation(clazz reflect.Type, key string, index int64) (*DeleteCompareExchangeValueOperation, error)

func (*DeleteCompareExchangeValueOperation) GetCommand Uses

func (o *DeleteCompareExchangeValueOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type DeleteDatabaseCommand Uses

type DeleteDatabaseCommand struct {
    RavenCommandBase

    Result *DeleteDatabaseResult
    // contains filtered or unexported fields
}

func NewDeleteDatabaseCommand Uses

func NewDeleteDatabaseCommand(conventions *DocumentConventions, parameters *DeleteDatabaseParameters) (*DeleteDatabaseCommand, error)

type DeleteDatabaseParameters Uses

type DeleteDatabaseParameters struct {
    DatabaseNames             []string       `json:"DatabaseNames"`
    HardDelete                bool           `json:"HardDelete"`
    FromNodes                 []string       `json:"FromNodes"`
    TimeToWaitForConfirmation *time.Duration `json:"TimeToWaitForConfirmation"`
}

type DeleteDatabaseResult Uses

type DeleteDatabaseResult struct {
    RaftCommandIndex int64    `json:"RaftCommandIndex"`
    PendingDeletes   []string `json:"PendingDeletes"`
}

DeleteDatabaseResult represents result of Delete Database command

type DeleteDatabasesOperation Uses

type DeleteDatabasesOperation struct {
    Command *DeleteDatabaseCommand
    // contains filtered or unexported fields
}

func NewDeleteDatabasesOperation Uses

func NewDeleteDatabasesOperation(databaseName string, hardDelete bool) *DeleteDatabasesOperation

func NewDeleteDatabasesOperation2 Uses

func NewDeleteDatabasesOperation2(databaseName string, hardDelete bool, fromNode string, timeToWaitForConfirmation time.Duration) *DeleteDatabasesOperation

func NewDeleteDatabasesOperationWithParameters Uses

func NewDeleteDatabasesOperationWithParameters(parameters *DeleteDatabaseParameters) *DeleteDatabasesOperation

func (*DeleteDatabasesOperation) GetCommand Uses

func (o *DeleteDatabasesOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type DeleteDocumentCommand Uses

type DeleteDocumentCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

func NewDeleteDocumentCommand Uses

func NewDeleteDocumentCommand(id string, changeVector *string) *DeleteDocumentCommand

type DeleteIndexCommand Uses

type DeleteIndexCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

func NewDeleteIndexCommand Uses

func NewDeleteIndexCommand(indexName string) (*DeleteIndexCommand, error)

type DeleteIndexOperation Uses

type DeleteIndexOperation struct {
    Command *DeleteIndexCommand
    // contains filtered or unexported fields
}

func NewDeleteIndexOperation Uses

func NewDeleteIndexOperation(indexName string) *DeleteIndexOperation

func (*DeleteIndexOperation) GetCommand Uses

func (o *DeleteIndexOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type DeleteSubscriptionCommand Uses

type DeleteSubscriptionCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

DeleteSubscriptionCommand describes "delete subscription" command

type DisableIndexCommand Uses

type DisableIndexCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

func NewDisableIndexCommand Uses

func NewDisableIndexCommand(indexName string) (*DisableIndexCommand, error)

type DisableIndexOperation Uses

type DisableIndexOperation struct {
    Command *DisableIndexCommand
    // contains filtered or unexported fields
}

func NewDisableIndexOperation Uses

func NewDisableIndexOperation(indexName string) (*DisableIndexOperation, error)

func (*DisableIndexOperation) GetCommand Uses

func (o *DisableIndexOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type DocumentChange Uses

type DocumentChange struct {
    Type           DocumentChangeTypes
    ID             string
    CollectionName string
    ChangeVector   *string
}

DocumentChange describes a change to the document. Can be used as DatabaseChange.

func (*DocumentChange) String Uses

func (c *DocumentChange) String() string

type DocumentChangeTypes Uses

type DocumentChangeTypes = string

type DocumentConflictError Uses

type DocumentConflictError struct {
    *ConflictException
    DocID       string
    LargestEtag int64
}

DocumentConflictError represents document conflict error from the server

func (DocumentConflictError) Error Uses

func (e DocumentConflictError) Error() string

Error makes it conform to error interface

type DocumentConventions Uses

type DocumentConventions struct {
    MaxNumberOfRequestsPerSession int
    // timeout for wait to server
    Timeout                  time.Duration
    UseOptimisticConcurrency bool
    // JsonDefaultMethod = DocumentConventions.json_default
    MaxLengthOfQueryUsingGetURL int
    IdentityPartsSeparator      string

    // If set to 'true' then it will return an error when any query is performed (in session)
    // without explicit page size set
    RaiseIfQueryPageSizeIsNotSet bool // TODO: rename to ErrorIfQueryPageSizeIsNotSet

    // allows overriding entity -> collection name logic
    FindCollectionName func(interface{}) string

    ReadBalanceBehavior ReadBalanceBehavior

    // if true, will return error if page size is not set
    ErrorIfQueryPageSizeIsNotSet bool
    // contains filtered or unexported fields
}

DocumentConventions describes document conventions

func NewDocumentConventions Uses

func NewDocumentConventions() *DocumentConventions

NewDocumentConventions creates DocumentConventions with default values

func (*DocumentConventions) Clone Uses

func (c *DocumentConventions) Clone() *DocumentConventions

func (*DocumentConventions) Freeze Uses

func (c *DocumentConventions) Freeze()

func (*DocumentConventions) GenerateDocumentID Uses

func (c *DocumentConventions) GenerateDocumentID(databaseName string, entity interface{}) (string, error)

Generates the document id.

func (*DocumentConventions) GetDocumentIDGenerator Uses

func (c *DocumentConventions) GetDocumentIDGenerator() DocumentIDGeneratorFunc

func (*DocumentConventions) GetIdentityPartsSeparator Uses

func (c *DocumentConventions) GetIdentityPartsSeparator() string

func (*DocumentConventions) GetIdentityProperty Uses

func (c *DocumentConventions) GetIdentityProperty(clazz reflect.Type) string

returns "" if no identity property

func (*DocumentConventions) GetTransformClassCollectionNameToDocumentIdPrefix Uses

func (c *DocumentConventions) GetTransformClassCollectionNameToDocumentIdPrefix() func(string) string

func (*DocumentConventions) IsDisableTopologyUpdates Uses

func (c *DocumentConventions) IsDisableTopologyUpdates() bool

func (*DocumentConventions) SetDisableTopologyUpdates Uses

func (c *DocumentConventions) SetDisableTopologyUpdates(disable bool)

func (*DocumentConventions) SetDocumentIDGenerator Uses

func (c *DocumentConventions) SetDocumentIDGenerator(documentIDGenerator DocumentIDGeneratorFunc)

func (*DocumentConventions) TryConvertValueForQuery Uses

func (c *DocumentConventions) TryConvertValueForQuery(fieldName string, value interface{}, forRange bool, stringValue *string) bool

func (*DocumentConventions) UpdateFrom Uses

func (c *DocumentConventions) UpdateFrom(configuration *ClientConfiguration)

type DocumentIDGeneratorFunc Uses

type DocumentIDGeneratorFunc func(dbName string, entity interface{}) (string, error)

type DocumentQuery Uses

type DocumentQuery struct {
    // contains filtered or unexported fields
}

DocumentQuery describes a query

func (*DocumentQuery) AddBeforeQueryExecutedListener Uses

func (q *DocumentQuery) AddBeforeQueryExecutedListener(action func(*IndexQuery)) int

func (*DocumentQuery) AddOrder Uses

func (q *DocumentQuery) AddOrder(fieldName string, descending bool) *DocumentQuery

func (*DocumentQuery) AddOrderWithOrdering Uses

func (q *DocumentQuery) AddOrderWithOrdering(fieldName string, descending bool, ordering OrderingType) *DocumentQuery

func (*DocumentQuery) AddParameter Uses

func (q *DocumentQuery) AddParameter(name string, value interface{}) *DocumentQuery

func (*DocumentQuery) AggregateByFacet Uses

func (q *DocumentQuery) AggregateByFacet(facet FacetBase) *AggregationDocumentQuery

func (*DocumentQuery) AggregateByFacets Uses

func (q *DocumentQuery) AggregateByFacets(facets ...*Facet) *AggregationDocumentQuery

func (*DocumentQuery) AggregateUsing Uses

func (q *DocumentQuery) AggregateUsing(facetSetupDocumentID string) *AggregationDocumentQuery

func (*DocumentQuery) AndAlso Uses

func (q *DocumentQuery) AndAlso() *DocumentQuery

func (DocumentQuery) Any Uses

func (q DocumentQuery) Any() (bool, error)

Any returns true if query returns at least one result TODO: write tests

func (*DocumentQuery) Boost Uses

func (q *DocumentQuery) Boost(boost float64) *DocumentQuery

func (*DocumentQuery) CloseSubclause Uses

func (q *DocumentQuery) CloseSubclause() *DocumentQuery

func (*DocumentQuery) ContainsAll Uses

func (q *DocumentQuery) ContainsAll(fieldName string, values []interface{}) *DocumentQuery

func (*DocumentQuery) ContainsAny Uses

func (q *DocumentQuery) ContainsAny(fieldName string, values []interface{}) *DocumentQuery

func (DocumentQuery) Count Uses

func (q DocumentQuery) Count() (int, error)

func (DocumentQuery) CountLazily Uses

func (q DocumentQuery) CountLazily() (*Lazy, error)

CountLazily returns a lazy operation that returns number of results in a query. It'll set *count to number of results after Lazy.GetResult() is called. results should be of type []<type> and is only provided so that we know this is a query for <type> TODO: figure out better API.

func (*DocumentQuery) Distinct Uses

func (q *DocumentQuery) Distinct() *DocumentQuery

Distinct marks query as distinct

func (*DocumentQuery) Exact Uses

func (q *DocumentQuery) Exact() *DocumentQuery

Exact marks previous Where statement (e.g. WhereEquals or WhereLucene) as exact

func (DocumentQuery) First Uses

func (q DocumentQuery) First(result interface{}) error

First runs a query and returns a first result.

func (*DocumentQuery) Fuzzy Uses

func (q *DocumentQuery) Fuzzy(fuzzy float64) *DocumentQuery

func (DocumentQuery) GetIndexQuery Uses

func (q DocumentQuery) GetIndexQuery() (*IndexQuery, error)

func (DocumentQuery) GetResults Uses

func (q DocumentQuery) GetResults(results interface{}) error

GetResults executes the query and sets results to returned values. results should be of type *[]<type>

func (*DocumentQuery) GroupBy Uses

func (q *DocumentQuery) GroupBy(fieldName string, fieldNames ...string) *GroupByDocumentQuery

GroupBy makes a query grouped by fields

func (*DocumentQuery) GroupByFieldWithMethod Uses

func (q *DocumentQuery) GroupByFieldWithMethod(field *GroupBy, fields ...*GroupBy) *GroupByDocumentQuery

GroupBy makes a query grouped by fields and also allows specifying method of grouping for each field

func (*DocumentQuery) Include Uses

func (q *DocumentQuery) Include(path string) *DocumentQuery

func (*DocumentQuery) Intersect Uses

func (q *DocumentQuery) Intersect() *DocumentQuery

func (DocumentQuery) Lazily Uses

func (q DocumentQuery) Lazily() (*Lazy, error)

func (*DocumentQuery) MoreLikeThis Uses

func (q *DocumentQuery) MoreLikeThis(moreLikeThis MoreLikeThisBase) *DocumentQuery

func (*DocumentQuery) MoreLikeThisWithBuilder Uses

func (q *DocumentQuery) MoreLikeThisWithBuilder(builder func(IMoreLikeThisBuilderForDocumentQuery)) *DocumentQuery

func (*DocumentQuery) NoCaching Uses

func (q *DocumentQuery) NoCaching() *DocumentQuery

func (*DocumentQuery) NoTracking Uses

func (q *DocumentQuery) NoTracking() *DocumentQuery

func (*DocumentQuery) Not Uses

func (q *DocumentQuery) Not() *DocumentQuery

func (*DocumentQuery) OpenSubclause Uses

func (q *DocumentQuery) OpenSubclause() *DocumentQuery

func (*DocumentQuery) OrElse Uses

func (q *DocumentQuery) OrElse() *DocumentQuery

func (*DocumentQuery) OrderBy Uses

func (q *DocumentQuery) OrderBy(field string) *DocumentQuery

OrderBy makes a query ordered by a given field

func (*DocumentQuery) OrderByDescending Uses

func (q *DocumentQuery) OrderByDescending(field string) *DocumentQuery

func (*DocumentQuery) OrderByDescendingWithOrdering Uses

func (q *DocumentQuery) OrderByDescendingWithOrdering(field string, ordering OrderingType) *DocumentQuery

func (*DocumentQuery) OrderByDistanceDescendingLatLong Uses

func (q *DocumentQuery) OrderByDistanceDescendingLatLong(fieldName string, latitude float64, longitude float64) *DocumentQuery

func (*DocumentQuery) OrderByDistanceDescendingLatLongDynamic Uses

func (q *DocumentQuery) OrderByDistanceDescendingLatLongDynamic(field DynamicSpatialField, latitude float64, longitude float64) *DocumentQuery

func (*DocumentQuery) OrderByDistanceDescendingWkt Uses

func (q *DocumentQuery) OrderByDistanceDescendingWkt(fieldName string, shapeWkt string) *DocumentQuery

func (*DocumentQuery) OrderByDistanceDescendingWktDynamic Uses

func (q *DocumentQuery) OrderByDistanceDescendingWktDynamic(field DynamicSpatialField, shapeWkt string) *DocumentQuery

func (*DocumentQuery) OrderByDistanceLatLong Uses

func (q *DocumentQuery) OrderByDistanceLatLong(fieldName string, latitude float64, longitude float64) *DocumentQuery

func (*DocumentQuery) OrderByDistanceLatLongDynamic Uses

func (q *DocumentQuery) OrderByDistanceLatLongDynamic(field DynamicSpatialField, latitude float64, longitude float64) *DocumentQuery

OrderByDistanceLatLongDynamic orders a given field by lat / long

func (*DocumentQuery) OrderByDistanceWkt Uses

func (q *DocumentQuery) OrderByDistanceWkt(fieldName string, shapeWkt string) *DocumentQuery

func (*DocumentQuery) OrderByDistanceWktDynamic Uses

func (q *DocumentQuery) OrderByDistanceWktDynamic(field DynamicSpatialField, shapeWkt string) *DocumentQuery

func (*DocumentQuery) OrderByScore Uses

func (q *DocumentQuery) OrderByScore() *DocumentQuery

OrderByScore orders results of the query by score

func (*DocumentQuery) OrderByScoreDescending Uses

func (q *DocumentQuery) OrderByScoreDescending() *DocumentQuery

OrderByScoreDescending orders results of the query by score in descending order

func (*DocumentQuery) OrderByWithOrdering Uses

func (q *DocumentQuery) OrderByWithOrdering(field string, ordering OrderingType) *DocumentQuery

func (*DocumentQuery) Proximity Uses

func (q *DocumentQuery) Proximity(proximity int) *DocumentQuery

func (*DocumentQuery) RandomOrdering Uses

func (q *DocumentQuery) RandomOrdering() *DocumentQuery

func (*DocumentQuery) RandomOrderingWithSeed Uses

func (q *DocumentQuery) RandomOrderingWithSeed(seed string) *DocumentQuery

func (*DocumentQuery) RelatesToShape Uses

func (q *DocumentQuery) RelatesToShape(fieldName string, shapeWkt string, relation SpatialRelation) *DocumentQuery

func (*DocumentQuery) RelatesToShapeWithError Uses

func (q *DocumentQuery) RelatesToShapeWithError(fieldName string, shapeWkt string, relation SpatialRelation, distanceErrorPct float64) *DocumentQuery

func (*DocumentQuery) RemoveBeforeQueryExecutedListener Uses

func (q *DocumentQuery) RemoveBeforeQueryExecutedListener(idx int) *DocumentQuery

func (*DocumentQuery) Search Uses

func (q *DocumentQuery) Search(fieldName string, searchTerms string) *DocumentQuery

func (*DocumentQuery) SearchWithOperator Uses

func (q *DocumentQuery) SearchWithOperator(fieldName string, searchTerms string, operator SearchOperator) *DocumentQuery

func (*DocumentQuery) SelectFields Uses

func (q *DocumentQuery) SelectFields(projectionType reflect.Type, fieldsIn ...string) *DocumentQuery

SelectFields limits the returned values to one or more fields of the queried type.

func (DocumentQuery) Single Uses

func (q DocumentQuery) Single(result interface{}) error

Single runs a query that expects only a single result. If there is more than one result, it retuns IllegalStateError.

func (*DocumentQuery) Skip Uses

func (q *DocumentQuery) Skip(count int) *DocumentQuery

func (*DocumentQuery) Spatial2 Uses

func (q *DocumentQuery) Spatial2(field DynamicSpatialField, clause func(*SpatialCriteriaFactory) SpatialCriteria) *DocumentQuery

func (*DocumentQuery) Spatial3 Uses

func (q *DocumentQuery) Spatial3(fieldName string, clause func(*SpatialCriteriaFactory) SpatialCriteria) *DocumentQuery

func (*DocumentQuery) Statistics Uses

func (q *DocumentQuery) Statistics(stats **QueryStatistics) *DocumentQuery

func (*DocumentQuery) SuggestUsing Uses

func (q *DocumentQuery) SuggestUsing(suggestion SuggestionBase) *SuggestionDocumentQuery

func (*DocumentQuery) Take Uses

func (q *DocumentQuery) Take(count int) *DocumentQuery

func (*DocumentQuery) UsingDefaultOperator Uses

func (q *DocumentQuery) UsingDefaultOperator(queryOperator QueryOperator) *DocumentQuery

func (*DocumentQuery) WaitForNonStaleResults Uses

func (q *DocumentQuery) WaitForNonStaleResults(waitTimeout time.Duration) *DocumentQuery

func (*DocumentQuery) WhereBetween Uses

func (q *DocumentQuery) WhereBetween(fieldName string, start interface{}, end interface{}) *DocumentQuery

func (*DocumentQuery) WhereEndsWith Uses

func (q *DocumentQuery) WhereEndsWith(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereEquals Uses

func (q *DocumentQuery) WhereEquals(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereEqualsWithMethodCall Uses

func (q *DocumentQuery) WhereEqualsWithMethodCall(fieldName string, method MethodCall) *DocumentQuery

func (*DocumentQuery) WhereEqualsWithParams Uses

func (q *DocumentQuery) WhereEqualsWithParams(whereParams *whereParams) *DocumentQuery

func (*DocumentQuery) WhereExists Uses

func (q *DocumentQuery) WhereExists(fieldName string) *DocumentQuery

func (*DocumentQuery) WhereGreaterThan Uses

func (q *DocumentQuery) WhereGreaterThan(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereGreaterThanOrEqual Uses

func (q *DocumentQuery) WhereGreaterThanOrEqual(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereIn Uses

func (q *DocumentQuery) WhereIn(fieldName string, values []interface{}) *DocumentQuery

func (*DocumentQuery) WhereLessThan Uses

func (q *DocumentQuery) WhereLessThan(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereLessThanOrEqual Uses

func (q *DocumentQuery) WhereLessThanOrEqual(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereLucene Uses

func (q *DocumentQuery) WhereLucene(fieldName string, whereClause string) *DocumentQuery

func (*DocumentQuery) WhereNotEquals Uses

func (q *DocumentQuery) WhereNotEquals(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WhereNotEqualsWithMethod Uses

func (q *DocumentQuery) WhereNotEqualsWithMethod(fieldName string, method MethodCall) *DocumentQuery

func (*DocumentQuery) WhereNotEqualsWithParams Uses

func (q *DocumentQuery) WhereNotEqualsWithParams(whereParams *whereParams) *DocumentQuery

func (*DocumentQuery) WhereRegex Uses

func (q *DocumentQuery) WhereRegex(fieldName string, pattern string) *DocumentQuery

func (*DocumentQuery) WhereStartsWith Uses

func (q *DocumentQuery) WhereStartsWith(fieldName string, value interface{}) *DocumentQuery

func (*DocumentQuery) WithinRadiusOf Uses

func (q *DocumentQuery) WithinRadiusOf(fieldName string, radius float64, latitude float64, longitude float64) *DocumentQuery

func (*DocumentQuery) WithinRadiusOfWithUnits Uses

func (q *DocumentQuery) WithinRadiusOfWithUnits(fieldName string, radius float64, latitude float64, longitude float64, radiusUnits SpatialUnits) *DocumentQuery

func (*DocumentQuery) WithinRadiusOfWithUnitsAndError Uses

func (q *DocumentQuery) WithinRadiusOfWithUnitsAndError(fieldName string, radius float64, latitude float64, longitude float64, radiusUnits SpatialUnits, distanceErrorPct float64) *DocumentQuery

type DocumentQueryCustomization Uses

type DocumentQueryCustomization struct {
    // contains filtered or unexported fields
}

DocumentQueryCustomization allows customizing query

func (*DocumentQueryCustomization) AddAfterQueryExecutedListener Uses

func (d *DocumentQueryCustomization) AddAfterQueryExecutedListener(action func(*QueryResult)) int

AddAfterQueryExecutedListener adds a callback to get the results of the query

func (*DocumentQueryCustomization) AddAfterStreamExecutedCallback Uses

func (d *DocumentQueryCustomization) AddAfterStreamExecutedCallback(action func(map[string]interface{})) int

AddAfterStreamExecutedCallback adds a callback to get stream result

func (*DocumentQueryCustomization) AddBeforeQueryExecutedListener Uses

func (d *DocumentQueryCustomization) AddBeforeQueryExecutedListener(action func(*IndexQuery)) int

AddBeforeQueryExecutedListener allows you to modify index query before it's executed

func (*DocumentQueryCustomization) GetQueryOperation Uses

func (d *DocumentQueryCustomization) GetQueryOperation() *queryOperation

GetQueryOperation returns raw query operation that will be sent to the server

func (*DocumentQueryCustomization) NoCaching Uses

func (d *DocumentQueryCustomization) NoCaching()

NoCaching disables caching for query results

func (*DocumentQueryCustomization) NoTracking Uses

func (d *DocumentQueryCustomization) NoTracking()

NoTracking disables tracking for quried entities by Raven's Unit of Work Using this option prevents hodling query results in memory

func (*DocumentQueryCustomization) RandomOrdering Uses

func (d *DocumentQueryCustomization) RandomOrdering()

RandomOrdering orders search results randomly.

func (*DocumentQueryCustomization) RandomOrderingWithSeed Uses

func (d *DocumentQueryCustomization) RandomOrderingWithSeed(seed string)

RandomOrdering orders search results randomly with a given seed. This is useful for repeatable random queries

func (*DocumentQueryCustomization) RemoveAfterQueryExecutedListener Uses

func (d *DocumentQueryCustomization) RemoveAfterQueryExecutedListener(idx int)

RemoveAfterQueryExecutedListener removes callback added with AddAfterQueryExecutedListener

func (*DocumentQueryCustomization) RemoveAfterStreamExecutedCallback Uses

func (d *DocumentQueryCustomization) RemoveAfterStreamExecutedCallback(idx int)

RemoveAfterStreamExecutedCallback remove callback added with AddAfterStreamExecutedCallback

func (*DocumentQueryCustomization) RemoveBeforeQueryExecutedListener Uses

func (d *DocumentQueryCustomization) RemoveBeforeQueryExecutedListener(idx int)

RemoveBeforeQueryExecutedListener removes listener added with AddBeforeQueryExecutedListener

func (*DocumentQueryCustomization) WaitForNonStaleResults Uses

func (d *DocumentQueryCustomization) WaitForNonStaleResults(waitTimeout time.Duration)

WaitForNonStaleResults instructs the query to wait for non results. waitTimeout of 0 means infinite timeout This shouldn't be used outside of unit tests unless you are well aware of the implications

type DocumentQueryOptions Uses

type DocumentQueryOptions struct {
    // CollectionName and Type are mutually exclusive
    // if Collection is empty string we'll derive name of the collection
    // from Type
    CollectionName string
    Type           reflect.Type

    // name of the index used for search query
    // if set, CollectionName and Type should not be set
    IndexName string

    IsMapReduce bool
    // contains filtered or unexported fields
}

DocumentQueryOptions describes options for creating a query

type DocumentSession Uses

type DocumentSession struct {
    *InMemoryDocumentSessionOperations
    // contains filtered or unexported fields
}

DocumentSession is a Unit of Work for accessing RavenDB server

func NewDocumentSession Uses

func NewDocumentSession(dbName string, documentStore *DocumentStore, id string, re *RequestExecutor) *DocumentSession

NewDocumentSession creates a new DocumentSession

func (*DocumentSession) Advanced Uses

func (s *DocumentSession) Advanced() *AdvancedSessionOperations

func (*DocumentSession) Attachments Uses

func (s *DocumentSession) Attachments() *AttachmentsSessionOperations

func (*DocumentSession) Eagerly Uses

func (s *DocumentSession) Eagerly() *EagerSessionOperations

func (*DocumentSession) Exists Uses

func (s *DocumentSession) Exists(id string) (bool, error)

Exists returns true if an entity with a given id exists in the database

func (*DocumentSession) Include Uses

func (s *DocumentSession) Include(path string) *MultiLoaderWithInclude

func (*DocumentSession) Increment Uses

func (s *DocumentSession) Increment(entity interface{}, path string, valueToAdd interface{}) error

Increment increments member identified by path in an entity by a given valueToAdd (can be negative, to subtract)

func (*DocumentSession) IncrementByID Uses

func (s *DocumentSession) IncrementByID(id string, path string, valueToAdd interface{}) error

IncrementByID increments member identified by path in an entity identified by id by a given valueToAdd (can be negative, to subtract)

func (*DocumentSession) Lazily Uses

func (s *DocumentSession) Lazily() *LazySessionOperations

func (*DocumentSession) Load Uses

func (s *DocumentSession) Load(result interface{}, id string) error

Load loads an entity with a given id and sets result to it. result should be of type **<struct> or *map[string]interface{}

func (*DocumentSession) LoadIntoStream Uses

func (s *DocumentSession) LoadIntoStream(ids []string, output io.Writer) error

LoadIntoStream loads entities identified by ids and writes them (in JSON form) to output

func (*DocumentSession) LoadMulti Uses

func (s *DocumentSession) LoadMulti(results interface{}, ids []string) error

LoadMulti loads multiple values with given ids into results, which should be a map from string (id) to pointer to struct

func (*DocumentSession) LoadStartingWith Uses

func (s *DocumentSession) LoadStartingWith(results interface{}, args *StartsWithArgs) error

func (*DocumentSession) LoadStartingWithIntoStream Uses

func (s *DocumentSession) LoadStartingWithIntoStream(output io.Writer, args *StartsWithArgs) error

func (*DocumentSession) Patch Uses

func (s *DocumentSession) Patch(entity interface{}, path string, value interface{}) error

Patch updates entity by changing part identified by path to a given value

func (*DocumentSession) PatchArray Uses

func (s *DocumentSession) PatchArray(entity interface{}, pathToArray string, arrayAdder func(*JavaScriptArray)) error

PatchArray updates an array value of document under a given path. Modify the array inside arrayAdder function

func (*DocumentSession) PatchArrayByID Uses

func (s *DocumentSession) PatchArrayByID(id string, pathToArray string, arrayAdder func(*JavaScriptArray)) error

func (*DocumentSession) PatchByID Uses

func (s *DocumentSession) PatchByID(id string, path string, value interface{}) error

PatchByID updates entity identified by id by changing part identified by path to a given value

func (*DocumentSession) Query Uses

func (s *DocumentSession) Query(opts *DocumentQueryOptions) *DocumentQuery

Query return a new DocumentQuery

func (*DocumentSession) QueryCollection Uses

func (s *DocumentSession) QueryCollection(collectionName string) *DocumentQuery

QueryCollection creates a new query over documents of a given collection

func (*DocumentSession) QueryCollectionForType Uses

func (s *DocumentSession) QueryCollectionForType(typ reflect.Type) *DocumentQuery

QueryCollectionForType creates a new query over documents of a given type

func (*DocumentSession) QueryIndex Uses

func (s *DocumentSession) QueryIndex(indexName string) *DocumentQuery

QueryIndex creates a new query in a index with a given name

func (*DocumentSession) RawQuery Uses

func (s *DocumentSession) RawQuery(rawQuery string) *RawDocumentQuery

RawQuery returns new DocumentQuery representing a raw query

func (*DocumentSession) Refresh Uses

func (s *DocumentSession) Refresh(entity interface{}) error

Refresh reloads information about a given entity in the session from the database

func (*DocumentSession) Revisions Uses

func (s *DocumentSession) Revisions() *RevisionsSessionOperations

func (*DocumentSession) SaveChanges Uses

func (s *DocumentSession) SaveChanges() error

SaveChanges saves changes queued in memory to the database

func (*DocumentSession) Stream Uses

func (s *DocumentSession) Stream(args *StartsWithArgs) (*StreamIterator, error)

Stream starts an iteration and returns StreamIterator

func (*DocumentSession) StreamQuery Uses

func (s *DocumentSession) StreamQuery(query *DocumentQuery, streamQueryStats *StreamQueryStatistics) (*StreamIterator, error)

StreamQuery starts a streaming query and returns iterator for results. If streamQueryStats is provided, it'll be filled with information about query statistics.

func (*DocumentSession) StreamQueryInto Uses

func (s *DocumentSession) StreamQueryInto(query *DocumentQuery, output io.Writer) error

StreamQueryInto starts a streaming query that will write the results (in JSON format) to output

func (*DocumentSession) StreamRawQuery Uses

func (s *DocumentSession) StreamRawQuery(query *RawDocumentQuery, streamQueryStats *StreamQueryStatistics) (*StreamIterator, error)

StreamRawQuery starts a raw streaming query and returns iterator for results. If streamQueryStats is provided, it'll be filled with information about query statistics.

func (*DocumentSession) StreamRawQueryInto Uses

func (s *DocumentSession) StreamRawQueryInto(query *RawDocumentQuery, output io.Writer) error

StreamRawQueryInto starts a raw streaming query that will write the results (in JSON format) to output

type DocumentSessionAttachments Uses

type DocumentSessionAttachments struct {
    *DocumentSessionAttachmentsBase
}

func NewDocumentSessionAttachments Uses

func NewDocumentSessionAttachments(session *InMemoryDocumentSessionOperations) *DocumentSessionAttachments

func (*DocumentSessionAttachments) Exists Uses

func (s *DocumentSessionAttachments) Exists(documentID string, name string) (bool, error)

func (*DocumentSessionAttachments) Get Uses

func (s *DocumentSessionAttachments) Get(entity interface{}, name string) (*AttachmentResult, error)

func (*DocumentSessionAttachments) GetByID Uses

func (s *DocumentSessionAttachments) GetByID(documentID string, name string) (*AttachmentResult, error)

func (*DocumentSessionAttachments) GetRevision Uses

func (s *DocumentSessionAttachments) GetRevision(documentID string, name string, changeVector *string) (*AttachmentResult, error)

type DocumentSessionAttachmentsBase Uses

type DocumentSessionAttachmentsBase struct {
    *AdvancedSessionExtensionBase
}

func NewDocumentSessionAttachmentsBase Uses

func NewDocumentSessionAttachmentsBase(session *InMemoryDocumentSessionOperations) *DocumentSessionAttachmentsBase

func (*DocumentSessionAttachmentsBase) Delete Uses

func (s *DocumentSessionAttachmentsBase) Delete(entity interface{}, name string) error

Delete deletes a given entity TODO: support **struct or return good error message

func (*DocumentSessionAttachmentsBase) DeleteByID Uses

func (s *DocumentSessionAttachmentsBase) DeleteByID(documentID string, name string) error

Delete deletes entity with a given i

func (*DocumentSessionAttachmentsBase) GetNames Uses

func (s *DocumentSessionAttachmentsBase) GetNames(entity interface{}) ([]*AttachmentName, error)

func (*DocumentSessionAttachmentsBase) Store Uses

func (s *DocumentSessionAttachmentsBase) Store(entity interface{}, name string, stream io.Reader, contentType string) error

Store stores an entity

func (*DocumentSessionAttachmentsBase) StoreByID Uses

func (s *DocumentSessionAttachmentsBase) StoreByID(documentID string, name string, stream io.Reader, contentType string) error

contentType is optional

type DocumentSessionRevisions Uses

type DocumentSessionRevisions struct {
    *AdvancedSessionExtensionBase
}

DocumentSessionRevisions represents revisions operations

func (*DocumentSessionRevisions) Get Uses

func (r *DocumentSessionRevisions) Get(result interface{}, changeVector string) error

func (*DocumentSessionRevisions) GetFor Uses

func (r *DocumentSessionRevisions) GetFor(results interface{}, id string) error

func (*DocumentSessionRevisions) GetForPaged Uses

func (r *DocumentSessionRevisions) GetForPaged(results interface{}, id string, start int, pageSize int) error

func (*DocumentSessionRevisions) GetForStartAt Uses

func (r *DocumentSessionRevisions) GetForStartAt(results interface{}, id string, start int) error

func (*DocumentSessionRevisions) GetMetadataFor Uses

func (r *DocumentSessionRevisions) GetMetadataFor(id string) ([]*MetadataAsDictionary, error)

func (*DocumentSessionRevisions) GetMetadataForPaged Uses

func (r *DocumentSessionRevisions) GetMetadataForPaged(id string, start int, pageSize int) ([]*MetadataAsDictionary, error)

func (*DocumentSessionRevisions) GetMetadataForStartAt Uses

func (r *DocumentSessionRevisions) GetMetadataForStartAt(id string, start int) ([]*MetadataAsDictionary, error)

func (*DocumentSessionRevisions) GetRevisions Uses

func (r *DocumentSessionRevisions) GetRevisions(results interface{}, changeVectors []string) error

type DocumentStore Uses

type DocumentStore struct {
    Certificate *tls.Certificate
    TrustStore  *x509.Certificate
    // contains filtered or unexported fields
}

DocumentStore represents a database

func NewDocumentStore Uses

func NewDocumentStore(urls []string, database string) *DocumentStore

func (*DocumentStore) AddAfterCloseListener Uses

func (s *DocumentStore) AddAfterCloseListener(fn func(*DocumentStore)) int

func (*DocumentStore) AddAfterSaveChangesListener Uses

func (s *DocumentStore) AddAfterSaveChangesListener(handler func(*AfterSaveChangesEventArgs)) int

AddAfterSaveChangesListener registers a function that will be called before saving changes. It'll be registered with every new session. Returns listener id that can be passed to RemoveAfterSaveChangesListener to unregister the listener.

func (*DocumentStore) AddBeforeCloseListener Uses

func (s *DocumentStore) AddBeforeCloseListener(fn func(*DocumentStore)) int

func (*DocumentStore) AddBeforeDeleteListener Uses

func (s *DocumentStore) AddBeforeDeleteListener(handler func(*BeforeDeleteEventArgs)) int

AddBeforeDeleteListener registers a function that will be called before deleting an entity. It'll be registered with every new session. Returns listener id that can be passed to RemoveBeforeDeleteListener to unregister the listener.

func (*DocumentStore) AddBeforeQueryListener Uses

func (s *DocumentStore) AddBeforeQueryListener(handler func(*BeforeQueryEventArgs)) int

AddBeforeQueryListener registers a function that will be called before running a query. It allows customizing query via DocumentQueryCustomization. It'll be registered with every new session. Returns listener id that can be passed to RemoveBeforeQueryListener to unregister the listener.

func (*DocumentStore) AddBeforeStoreListener Uses

func (s *DocumentStore) AddBeforeStoreListener(handler func(*BeforeStoreEventArgs)) int

AddBeforeStoreStoreListener registers a function that will be called before storing ab entity. It'll be registered with every new session. Returns listener id that can be passed to RemoveBeforeStoreListener to unregister the listener.

func (*DocumentStore) AggressivelyCache Uses

func (s *DocumentStore) AggressivelyCache(database string) (CancelFunc, error)

func (*DocumentStore) AggressivelyCacheFor Uses

func (s *DocumentStore) AggressivelyCacheFor(cacheDuration time.Duration) (CancelFunc, error)

func (*DocumentStore) AggressivelyCacheForDatabase Uses

func (s *DocumentStore) AggressivelyCacheForDatabase(cacheDuration time.Duration, database string) (CancelFunc, error)

func (*DocumentStore) BulkInsert Uses

func (s *DocumentStore) BulkInsert(database string) *BulkInsertOperation

func (*DocumentStore) Changes Uses

func (s *DocumentStore) Changes(database string) *DatabaseChanges

func (*DocumentStore) Close Uses

func (s *DocumentStore) Close()

Close closes the Store

func (*DocumentStore) DisableAggressiveCaching Uses

func (s *DocumentStore) DisableAggressiveCaching(databaseName string) *RestoreCaching

func (*DocumentStore) ExecuteIndex Uses

func (s *DocumentStore) ExecuteIndex(task *IndexCreationTask, database string) error

func (*DocumentStore) ExecuteIndexes Uses

func (s *DocumentStore) ExecuteIndexes(tasks []*IndexCreationTask, database string) error

func (*DocumentStore) GetConventions Uses

func (s *DocumentStore) GetConventions() *DocumentConventions

GetConventions returns DocumentConventions

func (*DocumentStore) GetDatabase Uses

func (s *DocumentStore) GetDatabase() string

func (*DocumentStore) GetIdentifier Uses

func (s *DocumentStore) GetIdentifier() string

Get an identifier of the store. For debugging / testing.

func (*DocumentStore) GetLastDatabaseChangesStateError Uses

func (s *DocumentStore) GetLastDatabaseChangesStateError(database string) error

func (*DocumentStore) GetRequestExecutor Uses

func (s *DocumentStore) GetRequestExecutor(database string) *RequestExecutor

GetRequestExecutor gets a request executor. database is optional

func (*DocumentStore) GetUrls Uses

func (s *DocumentStore) GetUrls() []string

GetUrls returns urls of all RavenDB nodes

func (*DocumentStore) Initialize Uses

func (s *DocumentStore) Initialize() error

Initialize initializes document Store, Must be called before executing any operation.

func (*DocumentStore) Maintenance Uses

func (s *DocumentStore) Maintenance() *MaintenanceOperationExecutor

func (*DocumentStore) OpenSession Uses

func (s *DocumentStore) OpenSession(database string) (*DocumentSession, error)

OpenSession opens a new session to document Store. If database is not given, we'll use store's database name

func (*DocumentStore) OpenSessionWithOptions Uses

func (s *DocumentStore) OpenSessionWithOptions(options *SessionOptions) (*DocumentSession, error)

func (*DocumentStore) Operations Uses

func (s *DocumentStore) Operations() *OperationExecutor

func (*DocumentStore) RemoveAfterCloseListener Uses

func (s *DocumentStore) RemoveAfterCloseListener(idx int)

func (*DocumentStore) RemoveAfterSaveChangesListener Uses

func (s *DocumentStore) RemoveAfterSaveChangesListener(handlerID int)

RemoveAfterSaveChangesListener removes a listener given id returned by AddAfterSaveChangesListener

func (*DocumentStore) RemoveBeforeCloseListener Uses

func (s *DocumentStore) RemoveBeforeCloseListener(idx int)

func (*DocumentStore) RemoveBeforeDeleteListener Uses

func (s *DocumentStore) RemoveBeforeDeleteListener(handlerID int)

RemoveBeforeDeleteListener removes a listener given id returned by AddBeforeDeleteListener

func (*DocumentStore) RemoveBeforeQueryListener Uses

func (s *DocumentStore) RemoveBeforeQueryListener(handlerID int)

RemoveBeforeQueryListener removes a listener given id returned by AddBeforeQueryListener

func (*DocumentStore) RemoveBeforeStoreListener Uses

func (s *DocumentStore) RemoveBeforeStoreListener(handlerID int)

RemoveBeforeStoreListener removes a listener given id returned by AddBeforeStoreListener

func (*DocumentStore) SetConventions Uses

func (s *DocumentStore) SetConventions(conventions *DocumentConventions)

SetConventions sets DocumentConventions

func (*DocumentStore) SetDatabase Uses

func (s *DocumentStore) SetDatabase(database string)

func (*DocumentStore) SetIdentifier Uses

func (s *DocumentStore) SetIdentifier(identifier string)

func (*DocumentStore) SetUrls Uses

func (s *DocumentStore) SetUrls(urls []string)

SetUrls sets initial urls of RavenDB nodes

func (*DocumentStore) Subscriptions Uses

func (s *DocumentStore) Subscriptions() *DocumentSubscriptions

Subscriptions returns DocumentSubscriptions which allows subscribing to changes in store

type DocumentSubscriptions Uses

type DocumentSubscriptions struct {
    // contains filtered or unexported fields
}

DocumentSubscriptions allows subscribing to changes in the store

func (*DocumentSubscriptions) Close Uses

func (s *DocumentSubscriptions) Close() error

Close closes subscriptions

func (*DocumentSubscriptions) Create Uses

func (s *DocumentSubscriptions) Create(options *SubscriptionCreationOptions, database string) (string, error)

Create creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.

func (*DocumentSubscriptions) CreateForRevisions Uses

func (s *DocumentSubscriptions) CreateForRevisions(clazz reflect.Type, options *SubscriptionCreationOptions, database string) (string, error)

CreateForRevisions creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.

func (*DocumentSubscriptions) CreateForType Uses

func (s *DocumentSubscriptions) CreateForType(clazz reflect.Type, options *SubscriptionCreationOptions, database string) (string, error)

CreateForType creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.

func (*DocumentSubscriptions) Delete Uses

func (s *DocumentSubscriptions) Delete(name string, database string) error

Delete deletes a subscription.

func (*DocumentSubscriptions) DropConnection Uses

func (s *DocumentSubscriptions) DropConnection(name string, database string) error

DropConnection forces server to close current client subscription connection to the server

func (*DocumentSubscriptions) GetSubscriptionState Uses

func (s *DocumentSubscriptions) GetSubscriptionState(subscriptionName string, database string) (*SubscriptionState, error)

GetSubscriptionState returns subscription definition and it's current state

func (*DocumentSubscriptions) GetSubscriptionWorker Uses

func (s *DocumentSubscriptions) GetSubscriptionWorker(clazz reflect.Type, options *SubscriptionWorkerOptions, database string) (*SubscriptionWorker, error)

GetSubscriptionWorker opens a subscription and starts pulling documents since a last processed document for that subscription. The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client needs to acknowledge that batch has been processed. The acknowledgment is sent after all documents are processed by subscription's handlers.

func (*DocumentSubscriptions) GetSubscriptionWorkerForRevisions Uses

func (s *DocumentSubscriptions) GetSubscriptionWorkerForRevisions(clazz reflect.Type, options *SubscriptionWorkerOptions, database string) (*SubscriptionWorker, error)

GetSubscriptionWorkerForRevisions opens a subscription and starts pulling documents since a last processed document for that subscription. The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client needs to acknowledge that batch has been processed. The acknowledgment is sent after all documents are processed by subscription's handlers.

func (*DocumentSubscriptions) GetSubscriptions Uses

func (s *DocumentSubscriptions) GetSubscriptions(start int, take int, database string) ([]*SubscriptionState, error)

GetSubscriptions downloads a list of all existing subscriptions in a database.

type DocumentsChanges Uses

type DocumentsChanges struct {
    FieldOldValue interface{}
    FieldNewValue interface{}
    FieldOldType  interface{}
    FieldNewType  interface{}
    Change        ChangeType
    FieldName     string
}

DocumentsChanges describes a change in a document

type DropSubscriptionConnectionCommand Uses

type DropSubscriptionConnectionCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

DropSubscriptionConnectionCommand describes "drop subscription" command

type Duration Uses

type Duration time.Duration

Duration is an alias for time.Duration that serializes to JSON in format compatible with ravendb server

func (Duration) MarshalJSON Uses

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON converts to JSON format (as a string)

func (*Duration) UnmarshalJSON Uses

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes from string

type DynamicSpatialField Uses

type DynamicSpatialField interface {
    // ToField returns a name of the field used in queries
    ToField(ensureValidFieldName func(string, bool) (string, error)) (string, error)
}

DynamicSpatialField is an interface for implementing name of the field to be queried

type EagerSessionOperations Uses

type EagerSessionOperations struct {
    // contains filtered or unexported fields
}

func (*EagerSessionOperations) ExecuteAllPendingLazyOperations Uses

func (s *EagerSessionOperations) ExecuteAllPendingLazyOperations() (*ResponseTimeInformation, error)

type EnableIndexCommand Uses

type EnableIndexCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

func NewEnableIndexCommand Uses

func NewEnableIndexCommand(indexName string) (*EnableIndexCommand, error)

type EnableIndexOperation Uses

type EnableIndexOperation struct {
    Command *EnableIndexCommand
    // contains filtered or unexported fields
}

func NewEnableIndexOperation Uses

func NewEnableIndexOperation(indexName string) (*EnableIndexOperation, error)

func (*EnableIndexOperation) GetCommand Uses

func (o *EnableIndexOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type EventHandler Uses

type EventHandler interface {
    // contains filtered or unexported methods
}

type ExplainQueryCommand Uses

type ExplainQueryCommand struct {
    RavenCommandBase

    Result []*ExplainQueryResult
    // contains filtered or unexported fields
}

func NewExplainQueryCommand Uses

func NewExplainQueryCommand(conventions *DocumentConventions, indexQuery *IndexQuery) *ExplainQueryCommand

type ExplainQueryResult Uses

type ExplainQueryResult struct {
    Index  string `json:"Index"`
    Reason string `json:"Reason"`
}

type ExternalReplication Uses

type ExternalReplication struct {
    ReplicationNode
    TaskID               int64  `json:"TaskId"`
    Name                 string `json:"Name"`
    ConnectionStringName string `json:"ConnectionStringName"`
    MentorName           string `json:"MentorName"`
}

ExternalReplication describes external replication

func NewExternalReplication Uses

func NewExternalReplication(database string, connectionStringName string) *ExternalReplication

NewExternalReplication creates ExternalReplication

type Facet Uses

type Facet struct {
    FacetBaseCommon

    FieldName string `json:"FieldName"`
}

Facet describes a search facet

func NewFacet Uses

func NewFacet() *Facet

NewFacet returns a new Facet

func (*Facet) ToFacetToken Uses

func (f *Facet) ToFacetToken(addQueryParameter func(interface{}) string) (*facetToken, error)

ToFacetToken returns token for this facet

type FacetAggregation Uses

type FacetAggregation = string

type FacetBase Uses

type FacetBase interface {
    // those are supplied by each type
    ToFacetToken(addQueryParameter func(interface{}) string) (*facetToken, error)

    // those are inherited from FacetBaseCommon
    SetDisplayFieldName(string)
    GetOptions() *FacetOptions
    SetOptions(*FacetOptions)
    GetAggregations() map[FacetAggregation]string
}

type FacetBaseCommon Uses

type FacetBaseCommon struct {
    DisplayFieldName string                      `json:"DisplayFieldName,omitempty"`
    Options          *FacetOptions               `json:"Options"`
    Aggregations     map[FacetAggregation]string `json:"Aggregations"`
}

func NewFacetBaseCommon Uses

func NewFacetBaseCommon() FacetBaseCommon

func (*FacetBaseCommon) GetAggregations Uses

func (f *FacetBaseCommon) GetAggregations() map[FacetAggregation]string

func (*FacetBaseCommon) GetOptions Uses

func (f *FacetBaseCommon) GetOptions() *FacetOptions

func (*FacetBaseCommon) SetDisplayFieldName Uses

func (f *FacetBaseCommon) SetDisplayFieldName(displayFieldName string)

func (*FacetBaseCommon) SetOptions Uses

func (f *FacetBaseCommon) SetOptions(options *FacetOptions)

type FacetBuilder Uses

type FacetBuilder struct {
    // contains filtered or unexported fields
}

func NewFacetBuilder Uses

func NewFacetBuilder() *FacetBuilder

func (*FacetBuilder) AllResults Uses

func (b *FacetBuilder) AllResults() *FacetBuilder

func (*FacetBuilder) AverageOn Uses

func (b *FacetBuilder) AverageOn(path string) *FacetBuilder

func (*FacetBuilder) ByField Uses

func (b *FacetBuilder) ByField(fieldName string) *FacetBuilder

func (*FacetBuilder) ByRanges Uses

func (b *FacetBuilder) ByRanges(rng *RangeBuilder, ranges ...*RangeBuilder) *FacetBuilder

func (*FacetBuilder) GetFacet Uses

func (b *FacetBuilder) GetFacet() FacetBase

func (*FacetBuilder) MaxOn Uses

func (b *FacetBuilder) MaxOn(path string) *FacetBuilder

func (*FacetBuilder) MinOn Uses

func (b *FacetBuilder) MinOn(path string) *FacetBuilder

func (*FacetBuilder) SumOn Uses

func (b *FacetBuilder) SumOn(path string) *FacetBuilder

func (*FacetBuilder) WithDisplayName Uses

func (b *FacetBuilder) WithDisplayName(displayName string) *FacetBuilder

func (*FacetBuilder) WithOptions Uses

func (b *FacetBuilder) WithOptions(options *FacetOptions) *FacetBuilder

type FacetOptions Uses

type FacetOptions struct {
    TermSortMode          FacetTermSortMode `json:"TermSortMode"`
    IncludeRemainingTerms bool              `json:"IncludeRemainingTerms"`
    Start                 int               `json:"Start"`
    PageSize              int               `json:"PageSize"`
}

FacetOptions describes options for facet

func NewFacetOptions Uses

func NewFacetOptions() *FacetOptions

NewFacetOptions returns new FacetOptions

type FacetResult Uses

type FacetResult struct {
    Name                string
    Values              []*FacetValue
    RemainingTerms      []string
    RemainingTermsCount int
    RemainingHits       int
}

FacetResults represents results of faceted search

type FacetSetup Uses

type FacetSetup struct {
    ID     string
    Facets []*Facet `json:"Facets,omitempty"`
    // Note: omitempty here is important. If we send 'null',
    // (as opposed to Java's '[]') the server will error out
    // when parsing query referencing this setup
    RangeFacets []*RangeFacet `json:"RangeFacets,omitempty"`
}

FacetSetup describes new facet setup

type FacetTermSortMode Uses

type FacetTermSortMode = string

FacetTermSortMode describes sort mode for a facet

type FacetValue Uses

type FacetValue struct {
    Range   string
    Count   int
    Sum     *float64
    Max     *float64
    Min     *float64
    Average *float64
}

func (*FacetValue) SetAverage Uses

func (v *FacetValue) SetAverage(average float64)

func (*FacetValue) SetMax Uses

func (v *FacetValue) SetMax(max float64)

func (*FacetValue) SetMin Uses

func (v *FacetValue) SetMin(min float64)

func (*FacetValue) SetSum Uses

func (v *FacetValue) SetSum(sum float64)

func (*FacetValue) String Uses

func (v *FacetValue) String() string

type FieldIndexing Uses

type FieldIndexing string

type FieldStorage Uses

type FieldStorage = string

type FieldTermVector Uses

type FieldTermVector = string

type GenericQueryResult Uses

type GenericQueryResult struct {
    TotalResults   int `json:"TotalResults"`
    SkippedResults int `json:"SkippedResults"`
    //TBD 4.1  map[string]map[string]List<String>>> highlightings
    DurationInMs      int64              `json:"DurationInMs"`
    ScoreExplanations map[string]string  `json:"ScoreExplanation"`
    TimingsInMs       map[string]float64 `json:"TimingsInMs"`
    ResultSize        int64              `json:"ResultSize"`
    // contains filtered or unexported fields
}

GenericQueryResult represents query results

type GenericRangeFacet Uses

type GenericRangeFacet struct {
    FacetBaseCommon

    Ranges []*RangeBuilder
    // contains filtered or unexported fields
}

GenericRangeFacet represents generic range facet

func NewGenericRangeFacet Uses

func NewGenericRangeFacet(parent FacetBase) *GenericRangeFacet

NewGenericRangeFacet returns new GenericRangeFacet parent is optional, can be nil

func (*GenericRangeFacet) ToFacetToken Uses

func (f *GenericRangeFacet) ToFacetToken(addQueryParameter func(interface{}) string) (*facetToken, error)

ToFacetToken returns facetToken from GenericRangeFacet

type GetAttachmentCommand Uses

type GetAttachmentCommand struct {
    RavenCommandBase

    Result *AttachmentResult
    // contains filtered or unexported fields
}

func NewGetAttachmentCommand Uses

func NewGetAttachmentCommand(documentID string, name string, typ AttachmentType, changeVector *string) (*GetAttachmentCommand, error)

TODO: should stream be io.ReadCloser? Who owns closing the attachment

type GetAttachmentOperation Uses

type GetAttachmentOperation struct {
    Command *GetAttachmentCommand
    // contains filtered or unexported fields
}

func NewGetAttachmentOperation Uses

func NewGetAttachmentOperation(documentID string, name string, typ AttachmentType, contentType string, changeVector *string) *GetAttachmentOperation

func (*GetAttachmentOperation) GetCommand Uses

func (o *GetAttachmentOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type GetClientConfigurationCommand Uses

type GetClientConfigurationCommand struct {
    RavenCommandBase

    Result *GetClientConfigurationCommandResult
}

func NewGetClientConfigurationCommand Uses

func NewGetClientConfigurationCommand() *GetClientConfigurationCommand

type GetClientConfigurationCommandResult Uses

type GetClientConfigurationCommandResult struct {
    Etag          int64                `json:"Etag"`
    Configuration *ClientConfiguration `json:"Configuration"`
}

type GetClientConfigurationOperation Uses

type GetClientConfigurationOperation struct {
    Command *GetClientConfigurationCommand
}

func NewGetClientConfigurationOperation Uses

func NewGetClientConfigurationOperation() *GetClientConfigurationOperation

func (*GetClientConfigurationOperation) GetCommand Uses

func (o *GetClientConfigurationOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetClusterTopologyCommand Uses

type GetClusterTopologyCommand struct {
    RavenCommandBase
    Result *ClusterTopologyResponse
}

func NewGetClusterTopologyCommand Uses

func NewGetClusterTopologyCommand() *GetClusterTopologyCommand

type GetCollectionStatisticsCommand Uses

type GetCollectionStatisticsCommand struct {
    RavenCommandBase

    Result *CollectionStatistics
}

func NewGetCollectionStatisticsCommand Uses

func NewGetCollectionStatisticsCommand() *GetCollectionStatisticsCommand

type GetCollectionStatisticsOperation Uses

type GetCollectionStatisticsOperation struct {
    Command *GetCollectionStatisticsCommand
}

func NewGetCollectionStatisticsOperation Uses

func NewGetCollectionStatisticsOperation() *GetCollectionStatisticsOperation

func (*GetCollectionStatisticsOperation) GetCommand Uses

func (o *GetCollectionStatisticsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetCompareExchangeValueCommand Uses

type GetCompareExchangeValueCommand struct {
    RavenCommandBase

    Result *CompareExchangeValue
    // contains filtered or unexported fields
}

func NewGetCompareExchangeValueCommand Uses

func NewGetCompareExchangeValueCommand(clazz reflect.Type, key string, conventions *DocumentConventions) (*GetCompareExchangeValueCommand, error)

type GetCompareExchangeValueOperation Uses

type GetCompareExchangeValueOperation struct {
    Command *GetCompareExchangeValueCommand
    // contains filtered or unexported fields
}

func NewGetCompareExchangeValueOperation Uses

func NewGetCompareExchangeValueOperation(clazz reflect.Type, key string) (*GetCompareExchangeValueOperation, error)

func (*GetCompareExchangeValueOperation) GetCommand Uses

func (o *GetCompareExchangeValueOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type GetCompareExchangeValuesCommand Uses

type GetCompareExchangeValuesCommand struct {
    RavenCommandBase

    Result map[string]*CompareExchangeValue
    // contains filtered or unexported fields
}

func NewGetCompareExchangeValuesCommand Uses

func NewGetCompareExchangeValuesCommand(operation *GetCompareExchangeValuesOperation, conventions *DocumentConventions) (*GetCompareExchangeValuesCommand, error)

type GetCompareExchangeValuesOperation Uses

type GetCompareExchangeValuesOperation struct {
    Command *GetCompareExchangeValuesCommand
    // contains filtered or unexported fields
}

func NewGetCompareExchangeValuesOperation Uses

func NewGetCompareExchangeValuesOperation(clazz reflect.Type, startWith string, start int, pageSize int) (*GetCompareExchangeValuesOperation, error)

func NewGetCompareExchangeValuesOperationWithKeys Uses

func NewGetCompareExchangeValuesOperationWithKeys(clazz reflect.Type, keys []string) (*GetCompareExchangeValuesOperation, error)

func (*GetCompareExchangeValuesOperation) GetCommand Uses

func (o *GetCompareExchangeValuesOperation) GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)

type GetConflictsCommand Uses

type GetConflictsCommand struct {
    RavenCommandBase

    Result *GetConflictsResult
    // contains filtered or unexported fields
}

func NewGetConflictsCommand Uses

func NewGetConflictsCommand(id string) *GetConflictsCommand

type GetConflictsResult Uses

type GetConflictsResult struct {
    ID          string      `json:"Id"`
    Results     []*Conflict `json:"Results"`
    LargestEtag int64       `json:"LargestEtag"`
}

GetConflictsResult represents result of "get conflict" command

type GetDatabaseNamesCommand Uses

type GetDatabaseNamesCommand struct {
    RavenCommandBase

    Result []string
    // contains filtered or unexported fields
}

func NewGetDatabaseNamesCommand Uses

func NewGetDatabaseNamesCommand(_start int, _pageSize int) *GetDatabaseNamesCommand

type GetDatabaseNamesOperation Uses

type GetDatabaseNamesOperation struct {
    // contains filtered or unexported fields
}

func NewGetDatabaseNamesOperation Uses

func NewGetDatabaseNamesOperation(_start int, _pageSize int) *GetDatabaseNamesOperation

func (*GetDatabaseNamesOperation) GetCommand Uses

func (o *GetDatabaseNamesOperation) GetCommand(conventions *DocumentConventions) *GetDatabaseNamesCommand

type GetDatabaseNamesResult Uses

type GetDatabaseNamesResult struct {
    Databases []string `json:"Databases"`
}

GetDatabaseNamesResult describes response of GetDatabaseNames command

type GetDatabaseRecordCommand Uses

type GetDatabaseRecordCommand struct {
    RavenCommandBase

    Result *DatabaseRecordWithEtag
    // contains filtered or unexported fields
}

func NewGetDatabaseRecordCommand Uses

func NewGetDatabaseRecordCommand(conventions *DocumentConventions, database string) *GetDatabaseRecordCommand

type GetDatabaseRecordOperation Uses

type GetDatabaseRecordOperation struct {
    Command *GetDatabaseRecordCommand
    // contains filtered or unexported fields
}

func NewGetDatabaseRecordOperation Uses

func NewGetDatabaseRecordOperation(database string) *GetDatabaseRecordOperation

func (*GetDatabaseRecordOperation) GetCommand Uses

func (o *GetDatabaseRecordOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetDatabaseTopologyCommand Uses

type GetDatabaseTopologyCommand struct {
    RavenCommandBase

    Result *Topology
}

func NewGetDatabaseTopologyCommand Uses

func NewGetDatabaseTopologyCommand() *GetDatabaseTopologyCommand

type GetDocumentsCommand Uses

type GetDocumentsCommand struct {
    RavenCommandBase

    Result *GetDocumentsResult
    // contains filtered or unexported fields
}

func NewGetDocumentsCommand Uses

func NewGetDocumentsCommand(ids []string, includes []string, metadataOnly bool) (*GetDocumentsCommand, error)

func NewGetDocumentsCommandFull Uses

func NewGetDocumentsCommandFull(startWith string, startAfter string, matches string, exclude string, start int, pageSize int, metadataOnly bool) (*GetDocumentsCommand, error)

type GetDocumentsResult Uses

type GetDocumentsResult struct {
    Includes      map[string]interface{}   `json:"Includes"`
    Results       []map[string]interface{} `json:"Results"`
    NextPageStart int                      `json:"NextPageStart"`
}

GetDocumentsResult is a result of GetDocument command

type GetIdentitiesCommand Uses

type GetIdentitiesCommand struct {
    RavenCommandBase

    Result map[string]int
}

func NewGetIdentitiesCommand Uses

func NewGetIdentitiesCommand() *GetIdentitiesCommand

type GetIdentitiesOperation Uses

type GetIdentitiesOperation struct {
    Command *GetIdentitiesCommand
}

func NewGetIdentitiesOperation Uses

func NewGetIdentitiesOperation() *GetIdentitiesOperation

func (*GetIdentitiesOperation) GetCommand Uses

func (o *GetIdentitiesOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexCommand Uses

type GetIndexCommand struct {
    RavenCommandBase

    Result *IndexDefinition
    // contains filtered or unexported fields
}

func NewGetIndexCommand Uses

func NewGetIndexCommand(indexName string) (*GetIndexCommand, error)

type GetIndexErrorsCommand Uses

type GetIndexErrorsCommand struct {
    RavenCommandBase

    Result []*IndexErrors
    // contains filtered or unexported fields
}

func NewGetIndexErrorsCommand Uses

func NewGetIndexErrorsCommand(indexNames []string) *GetIndexErrorsCommand

type GetIndexErrorsOperation Uses

type GetIndexErrorsOperation struct {
    Command *GetIndexErrorsCommand
    // contains filtered or unexported fields
}

func NewGetIndexErrorsOperation Uses

func NewGetIndexErrorsOperation(indexNames []string) *GetIndexErrorsOperation

func (*GetIndexErrorsOperation) GetCommand Uses

func (o *GetIndexErrorsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexNamesCommand Uses

type GetIndexNamesCommand struct {
    RavenCommandBase

    Result []string
    // contains filtered or unexported fields
}

func NewGetIndexNamesCommand Uses

func NewGetIndexNamesCommand(start int, pageSize int) *GetIndexNamesCommand

type GetIndexNamesOperation Uses

type GetIndexNamesOperation struct {
    Command *GetIndexNamesCommand
    // contains filtered or unexported fields
}

func NewGetIndexNamesOperation Uses

func NewGetIndexNamesOperation(start int, pageSize int) *GetIndexNamesOperation

func (*GetIndexNamesOperation) GetCommand Uses

func (o *GetIndexNamesOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexOperation Uses

type GetIndexOperation struct {
    Command *GetIndexCommand
    // contains filtered or unexported fields
}

func NewGetIndexOperation Uses

func NewGetIndexOperation(indexName string) *GetIndexOperation

func (*GetIndexOperation) GetCommand Uses

func (o *GetIndexOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexStatisticsCommand Uses

type GetIndexStatisticsCommand struct {
    RavenCommandBase

    Result *IndexStats
    // contains filtered or unexported fields
}

func NewGetIndexStatisticsCommand Uses

func NewGetIndexStatisticsCommand(indexName string) (*GetIndexStatisticsCommand, error)

type GetIndexStatisticsOperation Uses

type GetIndexStatisticsOperation struct {
    Command *GetIndexStatisticsCommand
    // contains filtered or unexported fields
}

func NewGetIndexStatisticsOperation Uses

func NewGetIndexStatisticsOperation(indexName string) *GetIndexStatisticsOperation

func (*GetIndexStatisticsOperation) GetCommand Uses

func (o *GetIndexStatisticsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexesCommand Uses

type GetIndexesCommand struct {
    RavenCommandBase

    Result []*IndexDefinition
    // contains filtered or unexported fields
}

func NewGetIndexesCommand Uses

func NewGetIndexesCommand(_start int, _pageSize int) *GetIndexesCommand

type GetIndexesOperation Uses

type GetIndexesOperation struct {
    Command *GetIndexesCommand
    // contains filtered or unexported fields
}

func NewGetIndexesOperation Uses

func NewGetIndexesOperation(_start int, _pageSize int) *GetIndexesOperation

func (*GetIndexesOperation) GetCommand Uses

func (o *GetIndexesOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexesStatisticsCommand Uses

type GetIndexesStatisticsCommand struct {
    RavenCommandBase

    Result []*IndexStats
}

func NewGetIndexesStatisticsCommand Uses

func NewGetIndexesStatisticsCommand() *GetIndexesStatisticsCommand

type GetIndexesStatisticsOperation Uses

type GetIndexesStatisticsOperation struct {
    Command *GetIndexesStatisticsCommand
}

func NewGetIndexesStatisticsOperation Uses

func NewGetIndexesStatisticsOperation() *GetIndexesStatisticsOperation

func (*GetIndexesStatisticsOperation) GetCommand Uses

func (o *GetIndexesStatisticsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetIndexingStatusCommand Uses

type GetIndexingStatusCommand struct {
    RavenCommandBase

    Result *IndexingStatus
}

func NewGetIndexingStatusCommand Uses

func NewGetIndexingStatusCommand() *GetIndexingStatusCommand

type GetIndexingStatusOperation Uses

type GetIndexingStatusOperation struct {
    Command *GetIndexingStatusCommand
}

func NewGetIndexingStatusOperation Uses

func NewGetIndexingStatusOperation() *GetIndexingStatusOperation

func (*GetIndexingStatusOperation) GetCommand Uses

func (o *GetIndexingStatusOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetNextOperationIDCommand Uses

type GetNextOperationIDCommand struct {
    RavenCommandBase

    Result int64
}

GetNextOperationIDCommand represents command for getting next id from the server

func NewGetNextOperationIDCommand Uses

func NewGetNextOperationIDCommand() *GetNextOperationIDCommand

NewGetNextOperationIDCommand returns GetNextOperationIDCommand

type GetOperationStateCommand Uses

type GetOperationStateCommand struct {
    RavenCommandBase

    Result map[string]interface{}
    // contains filtered or unexported fields
}

func NewGetOperationStateCommand Uses

func NewGetOperationStateCommand(conventions *DocumentConventions, id int64) *GetOperationStateCommand

type GetOperationStateOperation Uses

type GetOperationStateOperation struct {
    // contains filtered or unexported fields
}

func (*GetOperationStateOperation) GetCommand Uses

func (o *GetOperationStateOperation) GetCommand(conventions *DocumentConventions) *GetOperationStateCommand

type GetResponse Uses

type GetResponse struct {
    Result       []byte
    Headers      map[string]string
    StatusCode   int
    IsForceRetry bool
}

GetResponse represents result of get request

type GetRevisionOperation Uses

type GetRevisionOperation struct {
    // contains filtered or unexported fields
}

GetRevisionOperation represents "get revisions" operation

func NewGetRevisionOperationRange Uses

func NewGetRevisionOperationRange(session *InMemoryDocumentSessionOperations, id string, start int, pageSize int, metadataOnly bool) (*GetRevisionOperation, error)

func NewGetRevisionOperationWithChangeVectors Uses

func NewGetRevisionOperationWithChangeVectors(session *InMemoryDocumentSessionOperations, changeVectors []string) *GetRevisionOperation

func (*GetRevisionOperation) GetRevision Uses

func (o *GetRevisionOperation) GetRevision(result interface{}) error

func (*GetRevisionOperation) GetRevisionWithDocument Uses

func (o *GetRevisionOperation) GetRevisionWithDocument(result interface{}, document map[string]interface{}) error

Note: in Java it's getRevision

func (*GetRevisionOperation) GetRevisions Uses

func (o *GetRevisionOperation) GetRevisions(results interface{}) error

result should be map[string]<type>

func (*GetRevisionOperation) GetRevisionsFor Uses

func (o *GetRevisionOperation) GetRevisionsFor(results interface{}) error

results should be *[]*<type>

func (*GetRevisionOperation) GetRevisionsMetadataFor Uses

func (o *GetRevisionOperation) GetRevisionsMetadataFor() []*MetadataAsDictionary

type GetRevisionsBinEntryCommand Uses

type GetRevisionsBinEntryCommand struct {
    RavenCommandBase

    Result *JSONArrayResult
    // contains filtered or unexported fields
}

func NewGetRevisionsBinEntryCommand Uses

func NewGetRevisionsBinEntryCommand(etag int64, pageSize int) *GetRevisionsBinEntryCommand

type GetRevisionsCommand Uses

type GetRevisionsCommand struct {
    RavenCommandBase

    Result *JSONArrayResult
    // contains filtered or unexported fields
}

func NewGetRevisionsCommand Uses

func NewGetRevisionsCommand(changeVectors []string, metadataOnly bool) *GetRevisionsCommand

func NewGetRevisionsCommandRange Uses

func NewGetRevisionsCommandRange(id string, start int, pageSize int, metadataOnly bool) *GetRevisionsCommand

func (*GetRevisionsCommand) GetChangeVectors Uses

func (c *GetRevisionsCommand) GetChangeVectors() []string

type GetServerWideOperationStateCommand Uses

type GetServerWideOperationStateCommand struct {
    RavenCommandBase

    Result map[string]interface{}
    // contains filtered or unexported fields
}

func NewGetServerWideOperationStateCommand Uses

func NewGetServerWideOperationStateCommand(conventions *DocumentConventions, id int64) *GetServerWideOperationStateCommand

type GetServerWideOperationStateOperation Uses

type GetServerWideOperationStateOperation struct {
    // contains filtered or unexported fields
}

func (*GetServerWideOperationStateOperation) GetCommand Uses

func (o *GetServerWideOperationStateOperation) GetCommand(conventions *DocumentConventions) *GetServerWideOperationStateCommand

type GetStatisticsCommand Uses

type GetStatisticsCommand struct {
    RavenCommandBase

    Result *DatabaseStatistics
    // contains filtered or unexported fields
}

func NewGetStatisticsCommand Uses

func NewGetStatisticsCommand(debugTag string) *GetStatisticsCommand

type GetStatisticsOperation Uses

type GetStatisticsOperation struct {
    Command *GetStatisticsCommand
    // contains filtered or unexported fields
}

func NewGetStatisticsOperation Uses

func NewGetStatisticsOperation(debugTag string) *GetStatisticsOperation

func (*GetStatisticsOperation) GetCommand Uses

func (o *GetStatisticsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type GetSubscriptionStateCommand Uses

type GetSubscriptionStateCommand struct {
    RavenCommandBase

    Result *SubscriptionState
    // contains filtered or unexported fields
}

GetSubscriptionStateCommand describes "get subscription state" command

type GetSubscriptionsCommand Uses

type GetSubscriptionsCommand struct {
    RavenCommandBase

    Result []*SubscriptionState
    // contains filtered or unexported fields
}

GetSubscriptionsCommand describes "delete subscription" command

type GetSubscriptionsResult Uses

type GetSubscriptionsResult struct {
    Results []*SubscriptionState `json:"Results"`
}

GetSubscriptionsResult represents result of "get subscriptions"

type GetTcpInfoCommand Uses

type GetTcpInfoCommand struct {
    RavenCommandBase

    Result *TcpConnectionInfo
    // contains filtered or unexported fields
}

GetTcpInfoCommand describes "get tcp info" command

func NewGetTcpInfoCommand Uses

func NewGetTcpInfoCommand(tag, dbName string) *GetTcpInfoCommand

NewGetTcpInfoCommand returns new GetTcpInfoCommand dbName is optional

type GetTermsCommand Uses

type GetTermsCommand struct {
    RavenCommandBase

    Result []string
    // contains filtered or unexported fields
}

GetTermsCommand represents "get terms" command

func NewGetTermsCommand Uses

func NewGetTermsCommand(indexName string, field string, fromValue string, pageSize int) (*GetTermsCommand, error)

NewGetTermsCommand returns new GetTermsCommand

type GetTermsOperation Uses

type GetTermsOperation struct {
    Command *GetTermsCommand
    // contains filtered or unexported fields
}

GetTermsOperation represents "get terms" operation

func NewGetTermsOperation Uses

func NewGetTermsOperation(indexName string, field string, fromValue string, pageSize int) (*GetTermsOperation, error)

NewGetTermsOperation returns GetTermsOperation. pageSize 0 means default size

func (*GetTermsOperation) GetCommand Uses

func (o *GetTermsOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

GetCommand returns command for this operation

type GroupBy Uses

type GroupBy struct {
    Field  string
    Method GroupByMethod
}

GroupBy represents arguments to "group by" query

func NewGroupByArray Uses

func NewGroupByArray(fieldName string) *GroupBy

NewGroupByField returns new GroupBy for an array

func NewGroupByField Uses

func NewGroupByField(fieldName string) *GroupBy

NewGroupByField returns new GroupBy for a field

type GroupByDocumentQuery Uses

type GroupByDocumentQuery struct {
    // contains filtered or unexported fields
}

GroupByDocumentQuery represents a "group by" query

func (*GroupByDocumentQuery) SelectCount Uses

func (q *GroupByDocumentQuery) SelectCount() *DocumentQuery

func (*GroupByDocumentQuery) SelectCountWithName Uses

func (q *GroupByDocumentQuery) SelectCountWithName(projectedName string) *DocumentQuery

func (*GroupByDocumentQuery) SelectKey Uses

func (q *GroupByDocumentQuery) SelectKey() *GroupByDocumentQuery

func (*GroupByDocumentQuery) SelectKeyWithName Uses

func (q *GroupByDocumentQuery) SelectKeyWithName(fieldName string) *GroupByDocumentQuery

func (*GroupByDocumentQuery) SelectKeyWithNameAndProjectedName Uses

func (q *GroupByDocumentQuery) SelectKeyWithNameAndProjectedName(fieldName string, projectedName string) *GroupByDocumentQuery

func (*GroupByDocumentQuery) SelectSum Uses

func (q *GroupByDocumentQuery) SelectSum(field *GroupByField, fields ...*GroupByField) *DocumentQuery

type GroupByField Uses

type GroupByField struct {
    FieldName     string
    ProjectedName string
}

GroupByField represents a field by which to group in a query

type GroupByMethod Uses

type GroupByMethod = string

type HashCalculator Uses

type HashCalculator struct {
    // contains filtered or unexported fields
}

type HeadAttachmentCommand Uses

type HeadAttachmentCommand struct {
    RavenCommandBase

    Result string // TODO: should this be *string?
    // contains filtered or unexported fields
}

func NewHeadAttachmentCommand Uses

func NewHeadAttachmentCommand(documentID string, name string, changeVector *string) (*HeadAttachmentCommand, error)

type HeadDocumentCommand Uses

type HeadDocumentCommand struct {
    RavenCommandBase

    Result *string // change vector
    // contains filtered or unexported fields
}

HeadDocumentCommand describes "head document" command

func NewHeadDocumentCommand Uses

func NewHeadDocumentCommand(id string, changeVector *string) *HeadDocumentCommand

NewHeadDocumentCommand returns new HeadDocumentCommand

func (*HeadDocumentCommand) Exists Uses

func (c *HeadDocumentCommand) Exists() bool

Exists returns true if the command has a result

func (*HeadDocumentCommand) ProcessResponse Uses

func (c *HeadDocumentCommand) ProcessResponse(cache *httpCache, response *http.Response, url string) (responseDisposeHandling, error)

ProcessResponse processes HTTP response

type HiLoIDGenerator Uses

type HiLoIDGenerator struct {
    // contains filtered or unexported fields
}

HiLoIDGenerator generates document ids server side

func NewHiLoIDGenerator Uses

func NewHiLoIDGenerator(tag string, store *DocumentStore, dbName string, identityPartsSeparator string) *HiLoIDGenerator

NewHiLoIDGenerator creates a HiLoIDGenerator

func (*HiLoIDGenerator) GenerateDocumentID Uses

func (g *HiLoIDGenerator) GenerateDocumentID(entity interface{}) (string, error)

GenerateDocumentID returns next key

func (*HiLoIDGenerator) GetDocumentIDFromID Uses

func (g *HiLoIDGenerator) GetDocumentIDFromID(nextID int64) string

func (*HiLoIDGenerator) GetNextRange Uses

func (g *HiLoIDGenerator) GetNextRange() error

func (*HiLoIDGenerator) NextID Uses

func (g *HiLoIDGenerator) NextID() (int64, error)

func (*HiLoIDGenerator) ReturnUnusedRange Uses

func (g *HiLoIDGenerator) ReturnUnusedRange() error

ReturnUnusedRange returns unused range to the server

type HiLoResult Uses

type HiLoResult struct {
    Prefix      string `json:"Prefix"`
    Low         int64  `json:"Low"`
    High        int64  `json:"High"`
    LastSize    int64  `json:"LastSize"`
    ServerTag   string `json:"ServerTag"`
    LastRangeAt *Time  `json:"LastRangeAt"`
}

HiLoResult is a result of HiLoResult command

type HiLoReturnCommand Uses

type HiLoReturnCommand struct {
    RavenCommandBase
    // contains filtered or unexported fields
}

HiLoReturnCommand represents "hi lo return" command

func NewHiLoReturnCommand Uses

func NewHiLoReturnCommand(tag string, last int64, end int64) (*HiLoReturnCommand, error)

NewHiLoReturnCommand returns a new HiLoReturnCommand

type ICommandData Uses

type ICommandData interface {
    // contains filtered or unexported methods
}

ICommandData represents command data

func NewDeleteCommandData Uses

func NewDeleteCommandData(id string, changeVector string) ICommandData

NewDeleteCommandData creates ICommandData for Delete command

func NewPatchCommandData Uses

func NewPatchCommandData(id string, changeVector *string, patch *PatchRequest, patchIfMissing *PatchRequest) ICommandData

NewPatchCommandData creates CommandData for Delete Attachment command TODO: return a concrete type?

type IContent Uses

type IContent interface {
    // contains filtered or unexported methods
}

type ILazyOperation Uses

type ILazyOperation interface {
    // contains filtered or unexported methods
}

ILazyOperation defines methods required to implement lazy operation

type IMaintenanceOperation Uses

type IMaintenanceOperation interface {
    GetCommand(*DocumentConventions) (RavenCommand, error)
}

type IMoreLikeThisBuilderBase Uses

type IMoreLikeThisBuilderBase interface {
    UsingAnyDocument() IMoreLikeThisOperations
    UsingDocument(documentJson string) IMoreLikeThisOperations
}

type IMoreLikeThisBuilderForDocumentQuery Uses

type IMoreLikeThisBuilderForDocumentQuery interface {
    // Note: it's usingDocument() in Java but conflicts with IMoreLikeThisBuilderBase
    UsingDocumentWithBuilder(builder func(*DocumentQuery)) IMoreLikeThisOperations

    UsingAnyDocument() IMoreLikeThisOperations
    UsingDocument(string) IMoreLikeThisOperations
}

type IMoreLikeThisOperations Uses

type IMoreLikeThisOperations interface {
    WithOptions(options *MoreLikeThisOptions) IMoreLikeThisOperations
}

type IOperation Uses

type IOperation interface {
    GetCommand(store *DocumentStore, conventions *DocumentConventions, cache *httpCache) (RavenCommand, error)
}

type IServerOperation Uses

type IServerOperation interface {
    GetCommand(*DocumentConventions) (RavenCommand, error)
}

type IVoidMaintenanceOperation Uses

type IVoidMaintenanceOperation = IMaintenanceOperation

For documentation/porting only. Go has no generics so it's the same as IMaintenanceOperation

type IllegalArgumentError Uses

type IllegalArgumentError struct {
    // contains filtered or unexported fields
}

IllegalArgumentError represents illegal argument error

func (*IllegalArgumentError) Error Uses

func (e *IllegalArgumentError) Error() string

Error makes it conform to error interface

type IllegalStateError Uses

type IllegalStateError struct {
    // contains filtered or unexported fields
}

IllegalStateError represents illegal state error

func (*IllegalStateError) Error Uses

func (e *IllegalStateError) Error() string

Error makes it conform to error interface

type InMemoryDocumentSessionOperations Uses

type InMemoryDocumentSessionOperations struct {
    DatabaseName string

    Conventions *DocumentConventions
    // contains filtered or unexported fields
}

InMemoryDocumentSessionOperations represents database operations queued in memory

func (*InMemoryDocumentSessionOperations) AddAfterSaveChangesListener Uses

func (s *InMemoryDocumentSessionOperations) AddAfterSaveChangesListener(handler func(*AfterSaveChangesEventArgs)) int

AddAfterSaveChangesListener registers a function that will be called before saving changes. Returns listener id that can be passed to RemoveAfterSaveChangesListener to unregister the listener.

func (*InMemoryDocumentSessionOperations) AddBeforeDeleteListener Uses

func (s *InMemoryDocumentSessionOperations) AddBeforeDeleteListener(handler func(*BeforeDeleteEventArgs)) int

AddBeforeDeleteListener registers a function that will be called before deleting an entity. Returns listener id that can be passed to RemoveBeforeDeleteListener to unregister the listener.

func (*InMemoryDocumentSessionOperations) AddBeforeQueryListener Uses

func (s *InMemoryDocumentSessionOperations) AddBeforeQueryListener(handler func(*BeforeQueryEventArgs)) int

AddBeforeQueryListener registers a function that will be called before running a query. It allows customizing query via DocumentQueryCustomization. Returns listener id that can be passed to RemoveBeforeQueryListener to unregister the listener.

func (*InMemoryDocumentSessionOperations) AddBeforeStoreListener Uses

func (s *InMemoryDocumentSessionOperations) AddBeforeStoreListener(handler func(*BeforeStoreEventArgs)) int

AddBeforeStoreStoreListener registers a function that will be called before storing an entity. Returns listener id that can be passed to RemoveBeforeStoreListener to unregister the listener.

func (*InMemoryDocumentSessionOperations) Clear Uses

func (s *InMemoryDocumentSessionOperations) Clear()

Clear clears the session

func (*InMemoryDocumentSessionOperations) Close Uses

func (s *InMemoryDocumentSessionOperations) Close()

Close performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

func (*InMemoryDocumentSessionOperations) Defer Uses

func (s *InMemoryDocumentSessionOperations) Defer(commands ...ICommandData)

Defer defers commands to be executed on SaveChanges()

func (*InMemoryDocumentSessionOperations) Delete Uses

func (s *InMemoryDocumentSessionOperations) Delete(entity interface{}) error

Delete marks the specified entity for deletion. The entity will be deleted when SaveChanges is called.

func (*InMemoryDocumentSessionOperations) DeleteByID Uses

func (s *InMemoryDocumentSessionOperations) DeleteByID(id string, expectedChangeVector string) error

DeleteByID marks the specified entity for deletion. The entity will be deleted when SaveChanges is called. WARNING: This method will not call beforeDelete listener!

func (*InMemoryDocumentSessionOperations) Evict Uses

func (s *InMemoryDocumentSessionOperations) Evict(entity interface{}) error

Evict evicts the specified entity from the session. Remove the entity from the delete queue and stops tracking changes for this entity.

func (*InMemoryDocumentSessionOperations) GenerateID Uses

func (s *InMemoryDocumentSessionOperations) GenerateID(entity interface{}) (string, error)

func (*InMemoryDocumentSessionOperations) GetChangeVectorFor Uses

func (s *InMemoryDocumentSessionOperations) GetChangeVectorFor(instance interface{}) (*string, error)

GetChangeVectorFor returns metadata for a given instance empty string means there is not change vector

func (*InMemoryDocumentSessionOperations) GetConventions Uses

func (s *InMemoryDocumentSessionOperations) GetConventions() *DocumentConventions

GetConventions returns DocumentConventions

func (*InMemoryDocumentSessionOperations) GetCurrentSessionNode Uses

func (s *InMemoryDocumentSessionOperations) GetCurrentSessionNode() (*ServerNode, error)

func (*InMemoryDocumentSessionOperations) GetDeferredCommandsCount Uses

func (s *InMemoryDocumentSessionOperations) GetDeferredCommandsCount() int

GetDeferredCommandsCount returns number of deferred commands

func (*InMemoryDocumentSessionOperations) GetDocumentID Uses

func (s *InMemoryDocumentSessionOperations) GetDocumentID(instance interface{}) string

GetDocumentID returns id of a given instance

func (*InMemoryDocumentSessionOperations) GetDocumentStore Uses

func (s *InMemoryDocumentSessionOperations) GetDocumentStore() *DocumentStore

func (*InMemoryDocumentSessionOperations) GetLastModifiedFor Uses

func (s *InMemoryDocumentSessionOperations) GetLastModifiedFor(instance interface{}) (*time.Time, error)

GetLastModifiedFor returns last modified time for a given instance

func (*InMemoryDocumentSessionOperations) GetMetadataFor Uses

func (s *InMemoryDocumentSessionOperations) GetMetadataFor(instance interface{}) (*MetadataAsDictionary, error)

GetMetadataFor gets the metadata for the specified entity. TODO: should we make the API more robust by accepting **struct as well as *struct and doing the necessary tweaking automatically? It looks like GetMetadataFor(&foo) might be used reflexively and it might not be easy to figure out why it fails. Alternatively, error out early with informative error message

func (*InMemoryDocumentSessionOperations) GetNumberOfEntitiesInUnitOfWork Uses

func (s *InMemoryDocumentSessionOperations) GetNumberOfEntitiesInUnitOfWork() int

GetNumberOfEntitiesInUnitOfWork returns number of entities

func (*InMemoryDocumentSessionOperations) GetNumberOfRequests Uses

func (s *InMemoryDocumentSessionOperations) GetNumberOfRequests() int

GetNumberOfRequests returns number of requests sent to the server

func (*InMemoryDocumentSessionOperations) GetOperations Uses

func (s *InMemoryDocumentSessionOperations) GetOperations() *OperationExecutor

func (*InMemoryDocumentSessionOperations) GetRequestExecutor Uses

func (s *InMemoryDocumentSessionOperations) GetRequestExecutor() *RequestExecutor

func (*InMemoryDocumentSessionOperations) HasChanged Uses

func (s *InMemoryDocumentSessionOperations) HasChanged(entity interface{}) (bool, error)

HasChanged returns true if an entity has changed.

func (*InMemoryDocumentSessionOperations) HasChanges Uses

func (s *InMemoryDocumentSessionOperations) HasChanges() bool

Gets a value indicating whether any of the entities tracked by the session has changes.

func (*InMemoryDocumentSessionOperations) IgnoreChangesFor Uses

func (s *InMemoryDocumentSessionOperations) IgnoreChangesFor(entity interface{}) error

IgnoreChangesFor marks the entity as one that should be ignore for change tracking purposes, it still takes part in the session, but is ignored for SaveChanges.

func (*InMemoryDocumentSessionOperations) IsDeleted Uses

func (s *InMemoryDocumentSessionOperations) IsDeleted(id string) bool

IsDeleted returns true if document with this id is deleted in this session

func (*InMemoryDocumentSessionOperations) IsLoaded Uses

func (s *InMemoryDocumentSessionOperations) IsLoaded(id string) bool

IsLoaded returns true if document with this id is loaded

func (*InMemoryDocumentSessionOperations) IsLoadedOrDeleted Uses

func (s *InMemoryDocumentSessionOperations) IsLoadedOrDeleted(id string) bool

IsLoadedOrDeleted returns true if document with this id is loaded

func (*InMemoryDocumentSessionOperations) RemoveAfterSaveChangesListener Uses

func (s *InMemoryDocumentSessionOperations) RemoveAfterSaveChangesListener(handlerID int)

RemoveAfterSaveChangesListener removes a listener given id returned by AddAfterSaveChangesListener

func (*InMemoryDocumentSessionOperations) RemoveBeforeDeleteListener Uses

func (s *InMemoryDocumentSessionOperations) RemoveBeforeDeleteListener(handlerID int)

RemoveBeforeDeleteListener removes a listener given id returned by AddBeforeDeleteListener

func (*InMemoryDocumentSessionOperations) RemoveBeforeQueryListener Uses

func (s *InMemoryDocumentSessionOperations) RemoveBeforeQueryListener(handlerID int)

RemoveBeforeQueryListener removes a listener given id returned by AddBeforeQueryListener

func (*InMemoryDocumentSessionOperations) RemoveBeforeStoreListener Uses

func (s *InMemoryDocumentSessionOperations) RemoveBeforeStoreListener(handlerID int)

RemoveBeforeStoreListener removes a listener given id returned by AddBeforeStoreListener

func (*InMemoryDocumentSessionOperations) Store Uses

func (s *InMemoryDocumentSessionOperations) Store(entity interface{}) error

Store stores entity in the session. The entity will be saved when SaveChanges is called.

func (*InMemoryDocumentSessionOperations) StoreWithChangeVectorAndID Uses

func (s *InMemoryDocumentSessionOperations) StoreWithChangeVectorAndID(entity interface{}, changeVector string, id string) error

StoreWithChangeVectorAndID stores entity in the session, explicitly specifying its id and change vector. The entity will be saved when SaveChanges is called.

func (*InMemoryDocumentSessionOperations) StoreWithID Uses

func (s *InMemoryDocumentSessionOperations) StoreWithID(entity interface{}, id string) error

StoreWithID stores entity in the session, explicitly specifying its Id. The entity will be saved when SaveChanges is called.

func (*InMemoryDocumentSessionOperations) TrackEntity Uses

func (s *InMemoryDocumentSessionOperations) TrackEntity(result interface{}, id string, document map[string]interface{}, metadata map[string]interface{}, noTracking bool) error

TrackEntity tracks a given object result is a pointer to a decoded value (e.g. **Foo) and will be set with value decoded from JSON (e.g. *result = &Foo{})

func (*InMemoryDocumentSessionOperations) TrackEntityInDocumentInfo Uses

func (s *InMemoryDocumentSessionOperations) TrackEntityInDocumentInfo(result interface{}, documentFound *documentInfo) error

result is a pointer to expected value

func (*InMemoryDocumentSessionOperations) UpdateMetadataModifications Uses

func (s *InMemoryDocumentSessionOperations) UpdateMetadataModifications(documentInfo *documentInfo) bool

func (*InMemoryDocumentSessionOperations) WaitForIndexesAfterSaveChanges Uses

func (s *InMemoryDocumentSessionOperations) WaitForIndexesAfterSaveChanges(options func(*IndexesWaitOptsBuilder))

func (*InMemoryDocumentSessionOperations) WaitForReplicationAfterSaveChanges Uses

func (s *InMemoryDocumentSessionOperations) WaitForReplicationAfterSaveChanges(options func(*ReplicationWaitOptsBuilder))

func (*InMemoryDocumentSessionOperations) WhatChanged Uses

func (s *InMemoryDocumentSessionOperations) WhatChanged() (map[string][]*DocumentsChanges, error)

type IndexChange Uses

type IndexChange struct {
    Type IndexChangeTypes
    Name string
}

IndexChange describes a change to the index. Can be used as DatabaseChange.

type IndexChangeTypes Uses

type IndexChangeTypes = string

type IndexConfiguration Uses

type IndexConfiguration = map[string]string

TODO: desugar

func NewIndexConfiguration Uses

func NewIndexConfiguration() IndexConfiguration

type IndexCreationTask Uses

type IndexCreationTask struct {
    // for a single map index, set Map
    // for multiple map index, set Maps
    Map  string
    Maps []string

    Reduce string

    Conventions       *DocumentConventions
    AdditionalSources map[string]string
    Priority          IndexPriority
    LockMode          IndexLockMode

    StoresStrings         map[string]FieldStorage
    IndexesStrings        map[string]FieldIndexing
    AnalyzersStrings      map[string]string
    IndexSuggestions      []string
    TermVectorsStrings    map[string]FieldTermVector
    SpatialOptionsStrings map[string]*SpatialOptions

    OutputReduceToCollection string

    // Note: in Go IndexName must provided explicitly
    // In Java it's dynamically calculated as getClass().getSimpleName()
    IndexName string
}

IndexCreationTask is for creating IndexDefinition

func NewIndexCreationTask Uses

func NewIndexCreationTask(indexName string) *IndexCreationTask

NewAbstractIndexCreationTask returns new IndexCreationTask

func (*IndexCreationTask) Analyze Uses

func (t *IndexCreationTask) Analyze(field string, analyzer string)

Analyze registers field to be analyzed

func (*IndexCreationTask) CreateIndexDefinition Uses

func (t *IndexCreationTask) CreateIndexDefinition() *IndexDefinition

CreateIndexDefinition creates IndexDefinition

func (*IndexCreationTask) Execute Uses

func (t *IndexCreationTask) Execute(store *DocumentStore, conventions *DocumentConventions, database string) error

Execute executes index in specified document store

func (*IndexCreationTask) Index Uses

func (t *IndexCreationTask) Index(field string, indexing FieldIndexing)

Index registers field to be indexed

func (*IndexCreationTask) IsMapReduce Uses

func (t *IndexCreationTask) IsMapReduce() bool

IsMapReduce returns true if this is map-reduce index

func (*IndexCreationTask) Spatial Uses

func (t *IndexCreationTask) Spatial(field string, indexing func() *SpatialOptions)

Spatial registers field to be spatially indexed

func (*IndexCreationTask) Store Uses

func (t *IndexCreationTask) Store(field string, storage FieldStorage)

Store registers field to be stored

func (*IndexCreationTask) StoreAllFields Uses

func (t *IndexCreationTask) StoreAllFields(storage FieldStorage)

StoreAllFields selects if we're storing all fields or not

func (*IndexCreationTask) Suggestion Uses

func (t *IndexCreationTask) Suggestion(field string)

Suggestion registers field to be indexed as suggestions

func (*IndexCreationTask) TermVector Uses

func (t *IndexCreationTask) TermVector(field string, termVector FieldTermVector)

TermVector registers field to have term vectors

type IndexDefinition Uses

type IndexDefinition struct {
    Name              string                        `json:"Name"`
    Priority          IndexPriority                 `json:"Priority,omitempty"`
    LockMode          IndexLockMode                 `json:"LockMode,omitempty"`
    AdditionalSources map[string]string             `json:"AdditionalSources"`
    Maps              []string                      `json:"Maps"`
    Reduce            *string                       `json:"Reduce"`
    Fields            map[string]*IndexFieldOptions `json:"Fields"`
    Configuration     IndexConfiguration            `json:"Configuration"`
    IndexType         IndexType                     `json:"Type"`
    //TBD 4.1  bool testIndex;
    OutputReduceToCollection *string `json:"OutputReduceToCollection"`
}

func NewIndexDefinition Uses

func NewIndexDefinition() *IndexDefinition

func (*IndexDefinition) GetAdditionalSources Uses

func (d *IndexDefinition) GetAdditionalSources() map[string]string

func (*IndexDefinition) GetConfiguration Uses

func (d *IndexDefinition) GetConfiguration() IndexConfiguration

func (*IndexDefinition) GetFields Uses

func (d *IndexDefinition) GetFields() map[string]*IndexFieldOptions

func (*IndexDefinition) GetOutputReduceToCollection Uses

func (d *IndexDefinition) GetOutputReduceToCollection() *string

func (*IndexDefinition) GetType Uses

func (d *IndexDefinition) GetType() IndexType

func (*IndexDefinition) SetAdditionalSources Uses

func (d *IndexDefinition) SetAdditionalSources(additionalSources map[string]string)

func (*IndexDefinition) SetConfiguration Uses

func (d *IndexDefinition) SetConfiguration(configuration IndexConfiguration)

func (*IndexDefinition) SetOutputReduceToCollection Uses

func (d *IndexDefinition) SetOutputReduceToCollection(outputReduceToCollection string)

func (*IndexDefinition) SetType Uses

func (d *IndexDefinition) SetType(indexType IndexType)

func (*IndexDefinition) String Uses

func (d *IndexDefinition) String() string

type IndexDefinitionBuilder Uses

type IndexDefinitionBuilder struct {
    // contains filtered or unexported fields
}

func NewIndexDefinitionBuilder Uses

func NewIndexDefinitionBuilder(indexName string) *IndexDefinitionBuilder

type IndexDoesNotExistError Uses

type IndexDoesNotExistError struct {
    // contains filtered or unexported fields
}

IndexDoesNotExistError represents "index doesn't exist" error

func (*IndexDoesNotExistError) Error Uses

func (e *IndexDoesNotExistError) Error() string

Error makes it conform to error interface

type IndexErrors Uses

type IndexErrors struct {
    Name   string           `json:"Name"`
    Errors []*IndexingError `json:"Errors"`
}

IndexErrors describes index errors

type IndexFieldOptions Uses

type IndexFieldOptions struct {
    Storage     FieldStorage    `json:"Storage,omitempty"`
    Indexing    FieldIndexing   `json:"Indexing,omitempty"`
    TermVector  FieldTermVector `json:"TermVector,omitempty"`
    Spatial     *SpatialOptions `json:"Spatial"`
    Analyzer    string          `json:"Analyzer,omitempty"`
    Suggestions bool            `json:"Suggestions"`
}

func NewIndexFieldOptions Uses

func NewIndexFieldOptions() *IndexFieldOptions

type IndexHasChangedCommand Uses

type IndexHasChangedCommand struct {
    RavenCommandBase

    Result bool
    // contains filtered or unexported fields
}

func NewIndexHasChangedCommand Uses

func NewIndexHasChangedCommand(conventions *DocumentConventions, definition *IndexDefinition) (*IndexHasChangedCommand, error)

type IndexHasChangedOperation Uses

type IndexHasChangedOperation struct {
    Command *IndexHasChangedCommand
    // contains filtered or unexported fields
}

func NewIndexHasChangedOperation Uses

func NewIndexHasChangedOperation(definition *IndexDefinition) *IndexHasChangedOperation

func (*IndexHasChangedOperation) GetCommand Uses

func (o *IndexHasChangedOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error)

type IndexInformation Uses

type IndexInformation struct {
    Name             string        `json:"Name"`
    IsStale          bool          `json:"IsStale"`
    State            IndexState    `json:"State"`
    LockMode         IndexLockMode `json:"LockMode"`
    Priority         IndexPriority `json:"Priority"`
    Type             IndexType     `json:"Type"`
    LastIndexingTime Time          `json:"LastIndexingTime"`
}

func (*IndexInformation) GetLastIndexingTime Uses

func (i *IndexInformation) GetLastIndexingTime() time.Time

type IndexLockMode Uses

type IndexLockMode = string

type IndexPriority Uses

type IndexPriority = string

type IndexQuery Uses

type IndexQuery struct {
    // contains filtered or unexported fields
}

func NewIndexQuery Uses

func NewIndexQuery(query string) *IndexQuery

from IndexQuery

func (*IndexQuery) GetQuery Uses

func (q *IndexQuery) GetQuery() string

TODO: only for tests? Could expose with build-tags only for testing

func (*IndexQuery) GetQueryHash Uses

func (q *IndexQuery) GetQueryHash() string

func (*IndexQuery) GetQueryParameters Uses

func (q *IndexQuery) GetQueryParameters() Parameters

TODO: only for tests? Could expose with build-tags only for testing

func (*IndexQuery) String Uses

func (q *IndexQuery) String() string

type IndexQueryContent Uses

type IndexQueryContent struct {
    // contains filtered or unexported fields
}

func NewIndexQueryContent Uses

func NewIndexQueryContent(conventions *DocumentConventions, query *