neospace 0.0.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -0
  3. data/README.md +88 -0
  4. data/ffi/bolt/address.rb +11 -0
  5. data/ffi/bolt/address_resolver.rb +12 -0
  6. data/ffi/bolt/address_set.rb +9 -0
  7. data/ffi/bolt/auth.rb +10 -0
  8. data/ffi/bolt/auto_releasable.rb +22 -0
  9. data/ffi/bolt/boolean.rb +9 -0
  10. data/ffi/bolt/bytes.rb +10 -0
  11. data/ffi/bolt/config.rb +45 -0
  12. data/ffi/bolt/connection.rb +44 -0
  13. data/ffi/bolt/connector.rb +17 -0
  14. data/ffi/bolt/dictionary.rb +15 -0
  15. data/ffi/bolt/error.rb +74 -0
  16. data/ffi/bolt/float.rb +9 -0
  17. data/ffi/bolt/integer.rb +9 -0
  18. data/ffi/bolt/library.rb +12 -0
  19. data/ffi/bolt/lifecycle.rb +9 -0
  20. data/ffi/bolt/list.rb +10 -0
  21. data/ffi/bolt/log.rb +16 -0
  22. data/ffi/bolt/socket_options.rb +14 -0
  23. data/ffi/bolt/status.rb +25 -0
  24. data/ffi/bolt/string.rb +9 -0
  25. data/ffi/bolt/structure.rb +10 -0
  26. data/ffi/bolt/value.rb +35 -0
  27. data/ffi/neo4j/driver.rb +60 -0
  28. data/ffi/neo4j/driver/access_mode.rb +10 -0
  29. data/ffi/neo4j/driver/auth_tokens.rb +18 -0
  30. data/ffi/neo4j/driver/config.rb +40 -0
  31. data/ffi/neo4j/driver/graph_database.rb +52 -0
  32. data/ffi/neo4j/driver/internal/async/access_mode_connection.rb +19 -0
  33. data/ffi/neo4j/driver/internal/async/direct_connection.rb +106 -0
  34. data/ffi/neo4j/driver/internal/bolt_server_address.rb +18 -0
  35. data/ffi/neo4j/driver/internal/bookmarks_holder.rb +30 -0
  36. data/ffi/neo4j/driver/internal/direct_connection_provider.rb +28 -0
  37. data/ffi/neo4j/driver/internal/driver_factory.rb +125 -0
  38. data/ffi/neo4j/driver/internal/error_handling.rb +108 -0
  39. data/ffi/neo4j/driver/internal/explicit_transaction.rb +146 -0
  40. data/ffi/neo4j/driver/internal/handlers/pull_all_response_handler.rb +105 -0
  41. data/ffi/neo4j/driver/internal/handlers/response_handler.rb +49 -0
  42. data/ffi/neo4j/driver/internal/handlers/run_response_handler.rb +32 -0
  43. data/ffi/neo4j/driver/internal/handlers/session_pull_all_response_handler.rb +32 -0
  44. data/ffi/neo4j/driver/internal/handlers/transaction_pull_all_response_handler.rb +23 -0
  45. data/ffi/neo4j/driver/internal/internal_driver.rb +45 -0
  46. data/ffi/neo4j/driver/internal/internal_logger.rb +32 -0
  47. data/ffi/neo4j/driver/internal/internal_record.rb +26 -0
  48. data/ffi/neo4j/driver/internal/internal_resolver.rb +31 -0
  49. data/ffi/neo4j/driver/internal/internal_statement_result.rb +52 -0
  50. data/ffi/neo4j/driver/internal/messaging/bolt_protocol.rb +24 -0
  51. data/ffi/neo4j/driver/internal/messaging/v1/bolt_protocol_v1.rb +59 -0
  52. data/ffi/neo4j/driver/internal/messaging/v2/bolt_protocol_v2.rb +16 -0
  53. data/ffi/neo4j/driver/internal/messaging/v3/bolt_protocol_v3.rb +63 -0
  54. data/ffi/neo4j/driver/internal/network_session.rb +129 -0
  55. data/ffi/neo4j/driver/internal/retry/exponential_backoff_retry_logic.rb +80 -0
  56. data/ffi/neo4j/driver/internal/session_factory_impl.rb +28 -0
  57. data/ffi/neo4j/driver/internal/summary/internal_result_summary.rb +67 -0
  58. data/ffi/neo4j/driver/internal/summary/internal_server_info.rb +19 -0
  59. data/ffi/neo4j/driver/internal/summary/internal_summary_counters.rb +23 -0
  60. data/ffi/neo4j/driver/internal/util/metadata_extractor.rb +15 -0
  61. data/ffi/neo4j/driver/internal/value/base_time_value.rb +22 -0
  62. data/ffi/neo4j/driver/internal/value/date_value.rb +25 -0
  63. data/ffi/neo4j/driver/internal/value/duration_value.rb +27 -0
  64. data/ffi/neo4j/driver/internal/value/local_date_time_value.rb +24 -0
  65. data/ffi/neo4j/driver/internal/value/local_time_value.rb +19 -0
  66. data/ffi/neo4j/driver/internal/value/node_value.rb +18 -0
  67. data/ffi/neo4j/driver/internal/value/offset_time_value.rb +25 -0
  68. data/ffi/neo4j/driver/internal/value/path_value.rb +41 -0
  69. data/ffi/neo4j/driver/internal/value/point2_d_value.rb +24 -0
  70. data/ffi/neo4j/driver/internal/value/point3_d_value.rb +24 -0
  71. data/ffi/neo4j/driver/internal/value/relationship_value.rb +18 -0
  72. data/ffi/neo4j/driver/internal/value/structure_value.rb +42 -0
  73. data/ffi/neo4j/driver/internal/value/time_with_zone_id_value.rb +25 -0
  74. data/ffi/neo4j/driver/internal/value/time_with_zone_offset_value.rb +28 -0
  75. data/ffi/neo4j/driver/internal/value/unbound_relationship_value.rb +18 -0
  76. data/ffi/neo4j/driver/internal/value/value_adapter.rb +99 -0
  77. data/ffi/neo4j/driver/net/server_address.rb +13 -0
  78. data/ffi/neo4j/driver/statement.rb +15 -0
  79. data/ffi/neo4j/driver/summary/statement_type.rb +14 -0
  80. data/ffi/neo4j/driver/types/entity.rb +21 -0
  81. data/ffi/neo4j/driver/types/node.rb +16 -0
  82. data/ffi/neo4j/driver/types/path.rb +35 -0
  83. data/ffi/neo4j/driver/types/relationship.rb +19 -0
  84. data/lib/loader.rb +18 -0
  85. data/lib/neo4j/driver/auto_closable.rb +32 -0
  86. data/lib/neo4j/driver/exceptions/authentication_exception.rb +10 -0
  87. data/lib/neo4j/driver/exceptions/client_exception.rb +15 -0
  88. data/lib/neo4j/driver/exceptions/database_exception.rb +10 -0
  89. data/lib/neo4j/driver/exceptions/illegal_state_exception.rb +10 -0
  90. data/lib/neo4j/driver/exceptions/neo4j_exception.rb +23 -0
  91. data/lib/neo4j/driver/exceptions/no_such_record_exception.rb +33 -0
  92. data/lib/neo4j/driver/exceptions/protocol_exception.rb +10 -0
  93. data/lib/neo4j/driver/exceptions/security_exception.rb +10 -0
  94. data/lib/neo4j/driver/exceptions/service_unavailable_exception.rb +10 -0
  95. data/lib/neo4j/driver/exceptions/session_expired_exception.rb +10 -0
  96. data/lib/neo4j/driver/exceptions/transient_exception.rb +10 -0
  97. data/lib/neo4j/driver/exceptions/untrusted_server_exception.rb +10 -0
  98. data/lib/neo4j/driver/internal/duration_normalizer.rb +46 -0
  99. data/lib/neo4j/driver/internal/ruby_signature.rb +18 -0
  100. data/lib/neo4j/driver/internal/validator.rb +28 -0
  101. data/lib/neo4j/driver/types/bytes.rb +10 -0
  102. data/lib/neo4j/driver/types/local_date_time.rb +20 -0
  103. data/lib/neo4j/driver/types/local_time.rb +19 -0
  104. data/lib/neo4j/driver/types/offset_time.rb +19 -0
  105. data/lib/neo4j/driver/types/point.rb +39 -0
  106. data/lib/neo4j/driver/types/time.rb +43 -0
  107. data/lib/neo4j/driver/version.rb +7 -0
  108. data/lib/neo4j_ruby_driver.rb +20 -0
  109. metadata +314 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e936e5e4609c099a2a42fde44f703467581bc31fd9ae76b94278cc122ed4917
4
- data.tar.gz: 10976e4fe63cb9ef934dd5d598165d7e9576705679e71cf06040086266301c1e
3
+ metadata.gz: b177b6457d6b9e36fff7e3c1a09658c6ab407a1dd8b3f553f193d567a331932d
4
+ data.tar.gz: 04d6ac4ba12e2f00dbc108c7c0e604a8991d82d9b08392fb689c19367621fe00
5
5
  SHA512:
6
- metadata.gz: 0f327147fa33d788f1012a6936c349ec3649fc30b0a28d4c1d0cc6cbba693d6db82b801577dc57f6410996a193f80675dde8b53bb530cfd982cf616bc0162b57
7
- data.tar.gz: 1dcce2065578da1ec5f327624c6529ceb33f72b900d8fe03618bc72b238a236e630250d213c77ee1f7340be95c9e444d9cec27b111daf25118316cdc85f78a12
6
+ metadata.gz: 692745aa110972108d43c3d7e2a4dd3a89a0c6b0d50b4b169fdaa872d23837b57b32da9771c24e7c706f9a62429ff5e61b2fa1e399e2fd0401a94ca33f880d92
7
+ data.tar.gz: d9e29143572014a334ed4fedc48e09e2758873d4f85476f549e8c5c650e9902a3abc236fcefdf627c511757caf42d513573954c42bc91b5dba54930c2d0610ba
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Heinrich Klobuczek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,88 @@
1
+ # Neo4j::Driver
2
+
3
+ home :: https://github.com/neo4jrb/neo4j-ruby-driver
4
+
5
+ This repository contains 2 implementation of a neo4j driver for ruby:
6
+ - `neo4j-java-driver` based on official java implementation. It provides a thin wrapper over java driver (only in jruby).
7
+ - `neo4j-ruby-driver` based on [seabolt](https://github.com/neo4j-drivers/seabolt) and [ffi](https://github.com/ffi/ffi). Available on all rubies (including jruby) and all platforms supported by seabolt.
8
+
9
+ ## Installation
10
+
11
+ ### neo4j-java-driver
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'neo4j-java-driver'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install neo4j-java-driver
26
+
27
+ ### neo4j-ruby-driver
28
+
29
+ As a prerequisite seabolt must be installed.
30
+
31
+ On macOS
32
+
33
+ $ brew install michael-simons/homebrew-seabolt/seabolt
34
+
35
+ On other systems please follow the instructions to install [seabolt](https://github.com/neo4j-drivers/seabolt) either from package or source. Make sure the libseabolt17 ends up in a system lib path e.g. /usr/local/lib
36
+
37
+ Add this line to your application's Gemfile:
38
+
39
+ ```ruby
40
+ gem 'neo4j-ruby-driver'
41
+ ```
42
+
43
+ And then execute:
44
+
45
+ $ bundle
46
+
47
+ Or install it yourself as:
48
+
49
+ $ gem install neo4j-ruby-driver
50
+
51
+ ## Usage
52
+
53
+ Both drivers implement identical API and can be used interchangeably. The API is to highest possible degree consistent with the official java driver.
54
+ At this moment [The Neo4j Drivers Manual v1.7](https://neo4j.com/docs/driver-manual/1.7/) along with the ruby version of the [code fragments](https://github.com/neo4jrb/neo4j-ruby-driver/blob/master/docs/dev_manual_examples.rb) and the ruby specs provide the only documentation.
55
+
56
+ [Neo4j Java Driver 1.7 API](https://neo4j.com/docs/api/java-driver/current/) can be helpful as well..
57
+
58
+ ## Development
59
+
60
+ This gem includes 2 different implementations: java driver based and another one using seabolt via ffi
61
+
62
+ For java driver based:
63
+
64
+ $ driver=java bin/setup
65
+
66
+ FFI based same as above but with driver variable set:
67
+
68
+ $ bin/setup
69
+
70
+ ## Testing
71
+
72
+ To run the tests the following tools need to be installed:
73
+
74
+ $ brew install python
75
+ $ pip3 install --user git+https://github.com/klobuczek/boltkit@1.3#egg=boltkit
76
+ $ neoctrl-install -e 4.0.2 servers
77
+ $ neoctrl-configure servers/neo4j-enterprise-4.0.2 dbms.directories.import= dbms.default_listen_address=::
78
+ $ neoctrl-set-initial-password password servers/neo4j-enterprise-4.0.2
79
+ $ neoctrl-start servers/neo4j-enterprise-4.0.2
80
+
81
+ ## Contributing
82
+
83
+ Suggestions, improvements, bug reports and pull requests are welcome on GitHub at https://github.com/neo4jrb/neo4j-ruby-driver.
84
+
85
+ ## License
86
+
87
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
88
+
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Address
5
+ extend Bolt::Library
6
+ attach_function :create, :BoltAddress_create, %i[string string], :auto_pointer
7
+ attach_function :destroy, :BoltAddress_destroy, [:pointer], :void
8
+ attach_function :host, :BoltAddress_host, [:pointer], :strptr
9
+ attach_function :port, :BoltAddress_port, [:pointer], :strptr
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module AddressResolver
5
+ extend Bolt::Library
6
+
7
+ callback :address_resolver_func, %i[pointer pointer pointer], :void
8
+
9
+ attach_function :create, :BoltAddressResolver_create, %i[pointer address_resolver_func], :auto_pointer
10
+ attach_function :destroy, :BoltLog_destroy, %i[pointer], :void
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module AddressSet
5
+ extend Bolt::Library
6
+
7
+ attach_function :add, :BoltAddressSet_add, %i[pointer pointer], :int32_t
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Auth
5
+ extend Bolt::Library
6
+ attach_function :basic, :BoltAuth_basic, %i[string string string], :auto_pointer,
7
+ releaser: Bolt::Value.method(:destroy)
8
+ attach_function :none, :BoltAuth_none, [], :auto_pointer, releaser: Bolt::Value.method(:destroy)
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module AutoReleasable
5
+ def attach_function(name, func, args, returns = nil, options = nil)
6
+ return super unless returns == :auto_pointer
7
+
8
+ super(name, func, args, :pointer, options)
9
+ singleton_class.prepend with_auto_releaser(name, options&.dig(:releaser))
10
+ end
11
+
12
+ private
13
+
14
+ def with_auto_releaser(method, releaser)
15
+ Module.new do
16
+ define_method(method) do |*args|
17
+ FFI::AutoPointer.new(super(*args), releaser || self.method(:destroy))
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Boolean
5
+ extend Bolt::Library
6
+
7
+ attach_function :get, :BoltBoolean_get, %i[pointer], :char
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Bytes
5
+ extend Bolt::Library
6
+
7
+ attach_function :get, :BoltBytes_get, %i[pointer int32], :char
8
+ attach_function :get_all, :BoltBytes_get_all, %i[pointer], :pointer
9
+ end
10
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Config
5
+ extend Bolt::Library
6
+
7
+ BOLT_SCHEME_DIRECT = 0
8
+ BOLT_SCHEME_NEO4J = 1
9
+
10
+ typedef :int32_t, :bolt_scheme
11
+
12
+ BOLT_TRANSPORT_PLAINTEXT = 0
13
+ BOLT_TRANSPORT_ENCRYPTED = 1
14
+
15
+ typedef :int32_t, :bolt_transport
16
+
17
+ attach_function :create, :BoltConfig_create, [], :auto_pointer
18
+ attach_function :destroy, :BoltConfig_destroy, [:pointer], :void
19
+ attach_function :get_scheme, :BoltConfig_get_scheme, [:pointer], :bolt_scheme
20
+ attach_function :set_scheme, :BoltConfig_set_scheme, %i[pointer bolt_scheme], :int32_t
21
+ attach_function :get_transport, :BoltConfig_get_transport, [:pointer], :bolt_transport
22
+ attach_function :set_transport, :BoltConfig_set_transport, %i[pointer bolt_transport], :int32_t
23
+ attach_function :get_trust, :BoltConfig_get_trust, [:pointer], :pointer
24
+ attach_function :set_trust, :BoltConfig_set_trust, %i[pointer pointer], :int32_t
25
+ attach_function :get_user_agent, :BoltConfig_get_user_agent, [:pointer], :string
26
+ attach_function :set_user_agent, :BoltConfig_set_user_agent, %i[pointer string], :int32
27
+ attach_function :get_routing_context, :BoltConfig_get_routing_context, [:pointer], :pointer
28
+ attach_function :set_routing_context, :BoltConfig_set_routing_context, %i[pointer pointer], :int32_t
29
+ attach_function :get_address_resolver, :BoltConfig_get_address_resolver, [:pointer], :pointer
30
+ attach_function :set_address_resolver, :BoltConfig_set_address_resolver, %i[pointer pointer], :int32_t
31
+ attach_function :get_log, :BoltConfig_get_log, [:pointer], :pointer
32
+ attach_function :set_log, :BoltConfig_set_log, %i[pointer pointer], :int32
33
+ attach_function :get_max_pool_size, :BoltConfig_get_max_pool_size, [:pointer], :int32_t
34
+ attach_function :set_max_pool_size, :BoltConfig_set_max_pool_size, %i[pointer int32_t], :int32_t
35
+ attach_function :get_max_connection_life_time, :BoltConfig_get_max_connection_life_time, [:pointer], :int32_t
36
+ attach_function :set_max_connection_life_time, :BoltConfig_set_max_connection_life_time, %i[pointer int32_t],
37
+ :int32_t
38
+ attach_function :get_max_connection_acquisition_time, :BoltConfig_get_max_connection_acquisition_time, [:pointer],
39
+ :int32_t
40
+ attach_function :set_max_connection_acquisition_time, :BoltConfig_set_max_connection_acquisition_time,
41
+ %i[pointer int32_t], :int32_t
42
+ attach_function :get_socket_options, :BoltConfig_get_socket_options, [:pointer], :pointer
43
+ attach_function :set_socket_options, :BoltConfig_set_socket_options, %i[pointer pointer], :int32_t
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Connection
5
+ extend Bolt::Library
6
+
7
+ typedef :uint64, :bolt_request
8
+
9
+ attach_function :flush, :BoltConnection_send, [:pointer], :int32
10
+ attach_function :fetch, :BoltConnection_fetch, %i[pointer bolt_request], :int32
11
+ attach_function :fetch_summary, :BoltConnection_fetch_summary, %i[pointer bolt_request], :int32
12
+ attach_function :clear_begin, :BoltConnection_clear_begin, %i[pointer], :int32
13
+ attach_function :set_begin_bookmarks, :BoltConnection_set_begin_bookmarks, %i[pointer pointer], :int32
14
+ attach_function :set_begin_tx_timeout, :BoltConnection_set_begin_tx_timeout, %i[pointer int64], :int32
15
+ attach_function :set_begin_tx_metadata, :BoltConnection_set_begin_tx_metadata, %i[pointer pointer], :int32
16
+ attach_function :load_begin_request, :BoltConnection_load_begin_request, %i[pointer], :int32
17
+ attach_function :load_commit_request, :BoltConnection_load_commit_request, %i[pointer], :int32
18
+ attach_function :load_rollback_request, :BoltConnection_load_rollback_request, %i[pointer], :int32
19
+ attach_function :clear_run, :BoltConnection_clear_run, %i[pointer], :int32
20
+ attach_function :set_run_bookmarks, :BoltConnection_set_run_bookmarks, %i[pointer pointer], :int32
21
+ attach_function :set_run_tx_timeout, :BoltConnection_set_run_tx_timeout, %i[pointer int64], :int32
22
+ attach_function :set_run_tx_metadata, :BoltConnection_set_run_tx_metadata, %i[pointer pointer], :int32
23
+ attach_function :set_run_cypher, :BoltConnection_set_run_cypher, %i[pointer string uint64 int32], :int32
24
+ attach_function :set_run_cypher_parameter, :BoltConnection_set_run_cypher_parameter,
25
+ %i[pointer int32 string uint64], :pointer
26
+ attach_function :load_run_request, :BoltConnection_load_run_request, [:pointer], :int32
27
+ attach_function :load_discard_request, :BoltConnection_load_discard_request, %i[pointer int32], :int32
28
+ attach_function :load_pull_request, :BoltConnection_load_pull_request, %i[pointer int32], :int32
29
+ attach_function :load_reset_request, :BoltConnection_load_reset_request, [:pointer], :int32
30
+ attach_function :last_request, :BoltConnection_last_request, [:pointer], :bolt_request
31
+ attach_function :server, :BoltConnection_server, %i[pointer], :strptr
32
+ attach_function :id, :BoltConnection_id, %i[pointer], :strptr
33
+ attach_function :address, :BoltConnection_address, %i[pointer], :pointer
34
+ attach_function :remote_endpoint, :BoltConnection_remote_endpoint, %i[pointer], :pointer
35
+ attach_function :local_endpoint, :BoltConnection_local_endpoint, %i[pointer], :pointer
36
+ attach_function :last_bookmark, :BoltConnection_last_bookmark, %i[pointer], :strptr
37
+ attach_function :summary_success, :BoltConnection_summary_success, [:pointer], :int32
38
+ attach_function :failure, :BoltConnection_failure, [:pointer], :pointer
39
+ attach_function :field_names, :BoltConnection_field_names, [:pointer], :pointer
40
+ attach_function :field_values, :BoltConnection_field_values, [:pointer], :pointer
41
+ attach_function :metadata, :BoltConnection_metadata, %i[pointer], :pointer
42
+ attach_function :status, :BoltConnection_status, [:pointer], :pointer
43
+ end
44
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Connector
5
+ extend Bolt::Library
6
+
7
+ BoltAccessMode = enum(
8
+ :bolt_access_mode_write,
9
+ :bolt_access_mode_read
10
+ )
11
+
12
+ attach_function :create, :BoltConnector_create, %i[pointer pointer pointer], :pointer
13
+ attach_function :destroy, :BoltConnector_destroy, [:pointer], :void
14
+ attach_function :acquire, :BoltConnector_acquire, [:pointer, BoltAccessMode, :pointer], :pointer
15
+ attach_function :release, :BoltConnector_release, %i[pointer pointer], :void
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Dictionary
5
+ extend Bolt::Library
6
+
7
+ attach_function :key, :BoltDictionary_key, %i[pointer int32], :pointer
8
+ attach_function :get_key, :BoltDictionary_get_key, %i[pointer int32], :pointer
9
+ attach_function :get_key_size, :BoltDictionary_get_key_size, %i[pointer int32], :int32
10
+ attach_function :get_key_index, :BoltDictionary_get_key_index, %i[pointer string int32 int32], :int32
11
+ attach_function :set_key, :BoltDictionary_set_key, %i[pointer int32 string int32], :int32
12
+ attach_function :value, :BoltDictionary_value, %i[pointer int32], :pointer
13
+ attach_function :value_by_key, :BoltDictionary_value_by_key, %i[pointer string int32], :pointer
14
+ end
15
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Error
5
+ extend Bolt::Library
6
+
7
+ # Identifies a successful operation which is defined as 0
8
+ BOLT_SUCCESS = 0
9
+ # Unknown error
10
+ BOLT_UNKNOWN_ERROR = 1
11
+ # Unsupported protocol or address family
12
+ BOLT_UNSUPPORTED = 2
13
+ # Operation interrupted
14
+ BOLT_INTERRUPTED = 3
15
+ # Connection reset by peer
16
+ BOLT_CONNECTION_RESET = 4
17
+ # No valid resolved addresses found to connect
18
+ BOLT_NO_VALID_ADDRESS = 5
19
+ # Operation timed out
20
+ BOLT_TIMED_OUT = 6
21
+ # Permission denied
22
+ BOLT_PERMISSION_DENIED = 7
23
+ # Too may open files
24
+ BOLT_OUT_OF_FILES = 8
25
+ # Out of memory
26
+ BOLT_OUT_OF_MEMORY = 9
27
+ # Too many open ports
28
+ BOLT_OUT_OF_PORTS = 10
29
+ # Connection refused
30
+ BOLT_CONNECTION_REFUSED = 11
31
+ # Network unreachable
32
+ BOLT_NETWORK_UNREACHABLE = 12
33
+ # An unknown TLS error
34
+ BOLT_TLS_ERROR = 13
35
+ # Connection closed by remote peer
36
+ BOLT_END_OF_TRANSMISSION = 15
37
+ # Server returned a FAILURE message, more info available through \ref BoltConnection_failure
38
+ BOLT_SERVER_FAILURE = 16
39
+ # Unsupported bolt transport
40
+ BOLT_TRANSPORT_UNSUPPORTED = 0x400
41
+ # Unsupported protocol usage
42
+ BOLT_PROTOCOL_VIOLATION = 0x500
43
+ # Unsupported bolt type
44
+ BOLT_PROTOCOL_UNSUPPORTED_TYPE = 0x501
45
+ # Unknown pack stream type
46
+ BOLT_PROTOCOL_NOT_IMPLEMENTED_TYPE = 0x502
47
+ # Unexpected marker
48
+ BOLT_PROTOCOL_UNEXPECTED_MARKER = 0x503
49
+ # Unsupported bolt protocol version
50
+ BOLT_PROTOCOL_UNSUPPORTED = 0x504
51
+ # Connection pool is full
52
+ BOLT_POOL_FULL = 0x600
53
+ # Connection acquisition from the connection pool timed out
54
+ BOLT_POOL_ACQUISITION_TIMED_OUT = 0x601
55
+ # Address resolution failed
56
+ BOLT_ADDRESS_NOT_RESOLVED = 0x700
57
+ # Routing table retrieval failed
58
+ BOLT_ROUTING_UNABLE_TO_RETRIEVE_ROUTING_TABLE = 0x800
59
+ # No servers to select for the requested operation
60
+ BOLT_ROUTING_NO_SERVERS_TO_SELECT = 0x801
61
+ # Connection pool construction for server failed
62
+ BOLT_ROUTING_UNABLE_TO_CONSTRUCT_POOL_FOR_SERVER = 0x802
63
+ # Routing table refresh failed
64
+ BOLT_ROUTING_UNABLE_TO_REFRESH_ROUTING_TABLE = 0x803
65
+ # Invalid discovery response
66
+ BOLT_ROUTING_UNEXPECTED_DISCOVERY_RESPONSE = 0x804
67
+ # Error set in connection
68
+ BOLT_CONNECTION_HAS_MORE_INFO = 0xFFE
69
+ # Error set in connection
70
+ BOLT_STATUS_SET = 0xFFF
71
+
72
+ attach_function :get_string, :BoltError_get_string, [:int32], :string
73
+ end
74
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Float
5
+ extend Bolt::Library
6
+
7
+ attach_function :get, :BoltFloat_get, %i[pointer], :double
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Integer
5
+ extend Bolt::Library
6
+
7
+ attach_function :get, :BoltInteger_get, %i[pointer], :int64
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolt
4
+ module Library
5
+ include FFI::Library
6
+ include Bolt::AutoReleasable
7
+
8
+ def self.extended(mod)
9
+ mod.ffi_lib 'libseabolt17'
10
+ end
11
+ end
12
+ end