couchbase 3.5.0-x86_64-darwin-20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +202 -0
- data/README.md +154 -0
- data/ext/extconf.rb +0 -0
- data/lib/active_support/cache/couchbase_store.rb +339 -0
- data/lib/couchbase/3.0/libcouchbase.bundle +0 -0
- data/lib/couchbase/3.1/libcouchbase.bundle +0 -0
- data/lib/couchbase/3.2/libcouchbase.bundle +0 -0
- data/lib/couchbase/3.3/libcouchbase.bundle +0 -0
- data/lib/couchbase/analytics_options.rb +107 -0
- data/lib/couchbase/authenticator.rb +64 -0
- data/lib/couchbase/binary_collection.rb +128 -0
- data/lib/couchbase/binary_collection_options.rb +24 -0
- data/lib/couchbase/bucket.rb +144 -0
- data/lib/couchbase/cluster.rb +460 -0
- data/lib/couchbase/cluster_registry.rb +49 -0
- data/lib/couchbase/collection.rb +705 -0
- data/lib/couchbase/collection_options.rb +399 -0
- data/lib/couchbase/config_profiles.rb +55 -0
- data/lib/couchbase/configuration.rb +56 -0
- data/lib/couchbase/datastructures/couchbase_list.rb +160 -0
- data/lib/couchbase/datastructures/couchbase_map.rb +194 -0
- data/lib/couchbase/datastructures/couchbase_queue.rb +134 -0
- data/lib/couchbase/datastructures/couchbase_set.rb +128 -0
- data/lib/couchbase/datastructures.rb +24 -0
- data/lib/couchbase/diagnostics.rb +181 -0
- data/lib/couchbase/errors.rb +376 -0
- data/lib/couchbase/json_transcoder.rb +39 -0
- data/lib/couchbase/key_value_scan.rb +117 -0
- data/lib/couchbase/libcouchbase.rb +6 -0
- data/lib/couchbase/logger.rb +85 -0
- data/lib/couchbase/management/analytics_index_manager.rb +1127 -0
- data/lib/couchbase/management/bucket_manager.rb +443 -0
- data/lib/couchbase/management/collection_manager.rb +470 -0
- data/lib/couchbase/management/collection_query_index_manager.rb +222 -0
- data/lib/couchbase/management/query_index_manager.rb +617 -0
- data/lib/couchbase/management/scope_search_index_manager.rb +198 -0
- data/lib/couchbase/management/search_index_manager.rb +424 -0
- data/lib/couchbase/management/user_manager.rb +468 -0
- data/lib/couchbase/management/view_index_manager.rb +237 -0
- data/lib/couchbase/management.rb +29 -0
- data/lib/couchbase/mutation_state.rb +63 -0
- data/lib/couchbase/options.rb +2837 -0
- data/lib/couchbase/protostellar/binary_collection.rb +55 -0
- data/lib/couchbase/protostellar/bucket.rb +51 -0
- data/lib/couchbase/protostellar/client.rb +99 -0
- data/lib/couchbase/protostellar/cluster.rb +163 -0
- data/lib/couchbase/protostellar/collection.rb +152 -0
- data/lib/couchbase/protostellar/connect_options.rb +63 -0
- data/lib/couchbase/protostellar/error_handling.rb +203 -0
- data/lib/couchbase/protostellar/generated/admin/bucket/v1/bucket_pb.rb +61 -0
- data/lib/couchbase/protostellar/generated/admin/bucket/v1/bucket_services_pb.rb +35 -0
- data/lib/couchbase/protostellar/generated/admin/collection/v1/collection_pb.rb +57 -0
- data/lib/couchbase/protostellar/generated/admin/collection/v1/collection_services_pb.rb +36 -0
- data/lib/couchbase/protostellar/generated/admin/query/v1/query_pb.rb +61 -0
- data/lib/couchbase/protostellar/generated/admin/query/v1/query_services_pb.rb +37 -0
- data/lib/couchbase/protostellar/generated/admin/search/v1/search_pb.rb +72 -0
- data/lib/couchbase/protostellar/generated/admin/search/v1/search_services_pb.rb +44 -0
- data/lib/couchbase/protostellar/generated/analytics/v1/analytics_pb.rb +52 -0
- data/lib/couchbase/protostellar/generated/analytics/v1/analytics_services_pb.rb +30 -0
- data/lib/couchbase/protostellar/generated/internal/hooks/v1/hooks_pb.rb +70 -0
- data/lib/couchbase/protostellar/generated/internal/hooks/v1/hooks_services_pb.rb +36 -0
- data/lib/couchbase/protostellar/generated/kv/v1/kv_pb.rb +97 -0
- data/lib/couchbase/protostellar/generated/kv/v1/kv_services_pb.rb +46 -0
- data/lib/couchbase/protostellar/generated/query/v1/query_pb.rb +57 -0
- data/lib/couchbase/protostellar/generated/query/v1/query_services_pb.rb +30 -0
- data/lib/couchbase/protostellar/generated/routing/v1/routing_pb.rb +52 -0
- data/lib/couchbase/protostellar/generated/routing/v1/routing_services_pb.rb +30 -0
- data/lib/couchbase/protostellar/generated/search/v1/search_pb.rb +99 -0
- data/lib/couchbase/protostellar/generated/search/v1/search_services_pb.rb +30 -0
- data/lib/couchbase/protostellar/generated/transactions/v1/transactions_pb.rb +57 -0
- data/lib/couchbase/protostellar/generated/transactions/v1/transactions_services_pb.rb +36 -0
- data/lib/couchbase/protostellar/generated/view/v1/view_pb.rb +51 -0
- data/lib/couchbase/protostellar/generated/view/v1/view_services_pb.rb +30 -0
- data/lib/couchbase/protostellar/generated.rb +9 -0
- data/lib/couchbase/protostellar/management/bucket_manager.rb +67 -0
- data/lib/couchbase/protostellar/management/collection_manager.rb +94 -0
- data/lib/couchbase/protostellar/management/collection_query_index_manager.rb +124 -0
- data/lib/couchbase/protostellar/management/query_index_manager.rb +112 -0
- data/lib/couchbase/protostellar/management.rb +24 -0
- data/lib/couchbase/protostellar/request.rb +78 -0
- data/lib/couchbase/protostellar/request_behaviour.rb +42 -0
- data/lib/couchbase/protostellar/request_generator/admin/bucket.rb +124 -0
- data/lib/couchbase/protostellar/request_generator/admin/collection.rb +94 -0
- data/lib/couchbase/protostellar/request_generator/admin/query.rb +130 -0
- data/lib/couchbase/protostellar/request_generator/admin.rb +24 -0
- data/lib/couchbase/protostellar/request_generator/kv.rb +474 -0
- data/lib/couchbase/protostellar/request_generator/query.rb +133 -0
- data/lib/couchbase/protostellar/request_generator/search.rb +387 -0
- data/lib/couchbase/protostellar/request_generator.rb +26 -0
- data/lib/couchbase/protostellar/response_converter/admin/bucket.rb +55 -0
- data/lib/couchbase/protostellar/response_converter/admin/collection.rb +42 -0
- data/lib/couchbase/protostellar/response_converter/admin/query.rb +59 -0
- data/lib/couchbase/protostellar/response_converter/admin.rb +24 -0
- data/lib/couchbase/protostellar/response_converter/kv.rb +151 -0
- data/lib/couchbase/protostellar/response_converter/query.rb +84 -0
- data/lib/couchbase/protostellar/response_converter/search.rb +136 -0
- data/lib/couchbase/protostellar/response_converter.rb +26 -0
- data/lib/couchbase/protostellar/retry/action.rb +38 -0
- data/lib/couchbase/protostellar/retry/orchestrator.rb +60 -0
- data/lib/couchbase/protostellar/retry/reason.rb +67 -0
- data/lib/couchbase/protostellar/retry/strategies/best_effort.rb +49 -0
- data/lib/couchbase/protostellar/retry/strategies.rb +26 -0
- data/lib/couchbase/protostellar/retry.rb +28 -0
- data/lib/couchbase/protostellar/scope.rb +57 -0
- data/lib/couchbase/protostellar/timeout_defaults.rb +30 -0
- data/lib/couchbase/protostellar/timeouts.rb +83 -0
- data/lib/couchbase/protostellar.rb +29 -0
- data/lib/couchbase/query_options.rb +120 -0
- data/lib/couchbase/railtie.rb +45 -0
- data/lib/couchbase/raw_binary_transcoder.rb +37 -0
- data/lib/couchbase/raw_json_transcoder.rb +38 -0
- data/lib/couchbase/raw_string_transcoder.rb +40 -0
- data/lib/couchbase/scope.rb +256 -0
- data/lib/couchbase/search_options.rb +1622 -0
- data/lib/couchbase/subdoc.rb +290 -0
- data/lib/couchbase/transcoder_flags.rb +62 -0
- data/lib/couchbase/utils/generic_logger_adapter.rb +38 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +65 -0
- data/lib/couchbase/utils/time.rb +69 -0
- data/lib/couchbase/utils.rb +21 -0
- data/lib/couchbase/version.rb +23 -0
- data/lib/couchbase/view_options.rb +65 -0
- data/lib/couchbase.rb +28 -0
- data/lib/rails/generators/couchbase/config/config_generator.rb +27 -0
- metadata +191 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: couchbase/search/v1/search.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/duration_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
|
10
|
+
|
11
|
+
descriptor_data = "\n couchbase/search/v1/search.proto\x12\x13\x63ouchbase.search.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"^\n\x11\x42ooleanFieldQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\r\n\x05value\x18\x06 \x01(\x08\x42\x08\n\x06_boostB\x08\n\x06_field\"\x81\x02\n\x0c\x42ooleanQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x38\n\x04must\x18\x02 \x01(\x0b\x32%.couchbase.search.v1.ConjunctionQueryH\x01\x88\x01\x01\x12<\n\x08must_not\x18\x03 \x01(\x0b\x32%.couchbase.search.v1.DisjunctionQueryH\x02\x88\x01\x01\x12:\n\x06should\x18\x04 \x01(\x0b\x32%.couchbase.search.v1.DisjunctionQueryH\x03\x88\x01\x01\x42\x08\n\x06_boostB\x07\n\x05_mustB\x0b\n\t_must_notB\t\n\x07_should\"]\n\x10\x43onjunctionQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12+\n\x07queries\x18\x02 \x03(\x0b\x32\x1a.couchbase.search.v1.QueryB\x08\n\x06_boost\"\xcc\x01\n\x0e\x44\x61teRangeQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10\x64\x61te_time_parser\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x17\n\nstart_date\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x15\n\x08\x65nd_date\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x13\n\x11_date_time_parserB\r\n\x0b_start_dateB\x0b\n\t_end_date\"\x7f\n\x10\x44isjunctionQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12+\n\x07queries\x18\x02 \x03(\x0b\x32\x1a.couchbase.search.v1.Query\x12\x14\n\x07minimum\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x08\n\x06_boostB\n\n\x08_minimum\"7\n\nDocIdQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x03 \x03(\tB\x08\n\x06_boost\"-\n\x06LatLng\x12\x10\n\x08latitude\x18\x01 \x01(\x01\x12\x11\n\tlongitude\x18\x02 \x01(\x01\"\xb3\x01\n\x13GeoBoundingBoxQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12-\n\x08top_left\x18\x03 \x01(\x0b\x32\x1b.couchbase.search.v1.LatLng\x12\x31\n\x0c\x62ottom_right\x18\x04 \x01(\x0b\x32\x1b.couchbase.search.v1.LatLngB\x08\n\x06_boostB\x08\n\x06_field\"\x8d\x01\n\x10GeoDistanceQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12+\n\x06\x63\x65nter\x18\x03 \x01(\x0b\x32\x1b.couchbase.search.v1.LatLng\x12\x10\n\x08\x64istance\x18\x04 \x01(\tB\x08\n\x06_boostB\x08\n\x06_field\"|\n\x0fGeoPolygonQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12-\n\x08vertices\x18\x03 \x03(\x0b\x32\x1b.couchbase.search.v1.LatLngB\x08\n\x06_boostB\x08\n\x06_field\"\x0f\n\rMatchAllQuery\"\x10\n\x0eMatchNoneQuery\"\x82\x01\n\x10MatchPhraseQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06phrase\x18\x03 \x01(\t\x12\x15\n\x08\x61nalyzer\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x0b\n\t_analyzer\"\xcc\x02\n\nMatchQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\r\n\x05value\x18\x03 \x01(\t\x12\x15\n\x08\x61nalyzer\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tfuzziness\x18\x05 \x01(\x04H\x03\x88\x01\x01\x12?\n\x08operator\x18\x06 \x01(\x0e\x32(.couchbase.search.v1.MatchQuery.OperatorH\x04\x88\x01\x01\x12\x1a\n\rprefix_length\x18\x07 \x01(\x04H\x05\x88\x01\x01\"-\n\x08Operator\x12\x0f\n\x0bOPERATOR_OR\x10\x00\x12\x10\n\x0cOPERATOR_AND\x10\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x0b\n\t_analyzerB\x0c\n\n_fuzzinessB\x0b\n\t_operatorB\x10\n\x0e_prefix_length\"\xdf\x01\n\x11NumericRangeQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x10\n\x03min\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x10\n\x03max\x18\x04 \x01(\x02H\x03\x88\x01\x01\x12\x1a\n\rinclusive_min\x18\x05 \x01(\x08H\x04\x88\x01\x01\x12\x1a\n\rinclusive_max\x18\x06 \x01(\x08H\x05\x88\x01\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x06\n\x04_minB\x06\n\x04_maxB\x10\n\x0e_inclusive_minB\x10\n\x0e_inclusive_max\"X\n\x0bPhraseQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\r\n\x05terms\x18\x03 \x03(\tB\x08\n\x06_boostB\x08\n\x06_field\"Y\n\x0bPrefixQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06prefix\x18\x03 \x01(\tB\x08\n\x06_boostB\x08\n\x06_field\"F\n\x10QueryStringQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x14\n\x0cquery_string\x18\x03 \x01(\tB\x08\n\x06_boost\"Y\n\x0bRegexpQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x0e\n\x06regexp\x18\x03 \x01(\tB\x08\n\x06_boostB\x08\n\x06_field\"\xa9\x01\n\tTermQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x0c\n\x04term\x18\x03 \x01(\t\x12\x16\n\tfuzziness\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x1a\n\rprefix_length\x18\x05 \x01(\x04H\x03\x88\x01\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x0c\n\n_fuzzinessB\x10\n\x0e_prefix_length\"\xdc\x01\n\x0eTermRangeQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x10\n\x03min\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03max\x18\x06 \x01(\tH\x03\x88\x01\x01\x12\x1a\n\rinclusive_min\x18\x07 \x01(\x08H\x04\x88\x01\x01\x12\x1a\n\rinclusive_max\x18\x08 \x01(\x08H\x05\x88\x01\x01\x42\x08\n\x06_boostB\x08\n\x06_fieldB\x06\n\x04_minB\x06\n\x04_maxB\x10\n\x0e_inclusive_minB\x10\n\x0e_inclusive_max\"]\n\rWildcardQuery\x12\x12\n\x05\x62oost\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05\x66ield\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x10\n\x08wildcard\x18\x03 \x01(\tB\x08\n\x06_boostB\x08\n\x06_field\"\xd5\n\n\x05Query\x12\x45\n\x13\x62oolean_field_query\x18\x01 \x01(\x0b\x32&.couchbase.search.v1.BooleanFieldQueryH\x00\x12:\n\rboolean_query\x18\x02 \x01(\x0b\x32!.couchbase.search.v1.BooleanQueryH\x00\x12\x42\n\x11\x63onjunction_query\x18\x03 \x01(\x0b\x32%.couchbase.search.v1.ConjunctionQueryH\x00\x12?\n\x10\x64\x61te_range_query\x18\x04 \x01(\x0b\x32#.couchbase.search.v1.DateRangeQueryH\x00\x12\x42\n\x11\x64isjunction_query\x18\x05 \x01(\x0b\x32%.couchbase.search.v1.DisjunctionQueryH\x00\x12\x37\n\x0c\x64oc_id_query\x18\x06 \x01(\x0b\x32\x1f.couchbase.search.v1.DocIdQueryH\x00\x12J\n\x16geo_bounding_box_query\x18\x07 \x01(\x0b\x32(.couchbase.search.v1.GeoBoundingBoxQueryH\x00\x12\x43\n\x12geo_distance_query\x18\x08 \x01(\x0b\x32%.couchbase.search.v1.GeoDistanceQueryH\x00\x12\x41\n\x11geo_polygon_query\x18\t \x01(\x0b\x32$.couchbase.search.v1.GeoPolygonQueryH\x00\x12=\n\x0fmatch_all_query\x18\n \x01(\x0b\x32\".couchbase.search.v1.MatchAllQueryH\x00\x12?\n\x10match_none_query\x18\x0b \x01(\x0b\x32#.couchbase.search.v1.MatchNoneQueryH\x00\x12\x43\n\x12match_phrase_query\x18\x0c \x01(\x0b\x32%.couchbase.search.v1.MatchPhraseQueryH\x00\x12\x36\n\x0bmatch_query\x18\r \x01(\x0b\x32\x1f.couchbase.search.v1.MatchQueryH\x00\x12\x45\n\x13numeric_range_query\x18\x0e \x01(\x0b\x32&.couchbase.search.v1.NumericRangeQueryH\x00\x12\x38\n\x0cphrase_query\x18\x0f \x01(\x0b\x32 .couchbase.search.v1.PhraseQueryH\x00\x12\x38\n\x0cprefix_query\x18\x10 \x01(\x0b\x32 .couchbase.search.v1.PrefixQueryH\x00\x12\x43\n\x12query_string_query\x18\x11 \x01(\x0b\x32%.couchbase.search.v1.QueryStringQueryH\x00\x12\x38\n\x0cregexp_query\x18\x12 \x01(\x0b\x32 .couchbase.search.v1.RegexpQueryH\x00\x12\x34\n\nterm_query\x18\x13 \x01(\x0b\x32\x1e.couchbase.search.v1.TermQueryH\x00\x12?\n\x10term_range_query\x18\x14 \x01(\x0b\x32#.couchbase.search.v1.TermRangeQueryH\x00\x12<\n\x0ewildcard_query\x18\x15 \x01(\x0b\x32\".couchbase.search.v1.WildcardQueryH\x00\x42\x07\n\x05query\"^\n\x0c\x46ieldSorting\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x12\n\ndescending\x18\x02 \x01(\x08\x12\x0f\n\x07missing\x18\x03 \x01(\t\x12\x0c\n\x04mode\x18\x04 \x01(\t\x12\x0c\n\x04type\x18\x05 \x01(\t\"r\n\x12GeoDistanceSorting\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x12\n\ndescending\x18\x02 \x01(\x08\x12+\n\x06\x63\x65nter\x18\x03 \x01(\x0b\x32\x1b.couchbase.search.v1.LatLng\x12\x0c\n\x04unit\x18\x04 \x01(\t\"\x1f\n\tIdSorting\x12\x12\n\ndescending\x18\x01 \x01(\x08\"\"\n\x0cScoreSorting\x12\x12\n\ndescending\x18\x01 \x01(\x08\"\x8b\x02\n\x07Sorting\x12:\n\rfield_sorting\x18\x01 \x01(\x0b\x32!.couchbase.search.v1.FieldSortingH\x00\x12G\n\x14geo_distance_sorting\x18\x02 \x01(\x0b\x32\'.couchbase.search.v1.GeoDistanceSortingH\x00\x12\x34\n\nid_sorting\x18\x03 \x01(\x0b\x32\x1e.couchbase.search.v1.IdSortingH\x00\x12:\n\rscore_sorting\x18\x04 \x01(\x0b\x32!.couchbase.search.v1.ScoreSortingH\x00\x42\t\n\x07sorting\"Q\n\tDateRange\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\x05start\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03\x65nd\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"b\n\x0e\x44\x61teRangeFacet\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\r\x12\x33\n\x0b\x64\x61te_ranges\x18\x03 \x03(\x0b\x32\x1e.couchbase.search.v1.DateRange\"P\n\x0cNumericRange\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03min\x18\x02 \x01(\x02H\x00\x88\x01\x01\x12\x10\n\x03max\x18\x03 \x01(\x02H\x01\x88\x01\x01\x42\x06\n\x04_minB\x06\n\x04_max\"k\n\x11NumericRangeFacet\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\r\x12\x39\n\x0enumeric_ranges\x18\x03 \x03(\x0b\x32!.couchbase.search.v1.NumericRange\"(\n\tTermFacet\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\r\"\xce\x01\n\x05\x46\x61\x63\x65t\x12?\n\x10\x64\x61te_range_facet\x18\x01 \x01(\x0b\x32#.couchbase.search.v1.DateRangeFacetH\x00\x12\x45\n\x13numeric_range_facet\x18\x02 \x01(\x0b\x32&.couchbase.search.v1.NumericRangeFacetH\x00\x12\x34\n\nterm_facet\x18\x03 \x01(\x0b\x32\x1e.couchbase.search.v1.TermFacetH\x00\x42\x07\n\x05\x66\x61\x63\x65t\"\xca\x06\n\x12SearchQueryRequest\x12\x12\n\nindex_name\x18\x01 \x01(\t\x12)\n\x05query\x18\x02 \x01(\x0b\x32\x1a.couchbase.search.v1.Query\x12Q\n\x10scan_consistency\x18\x03 \x01(\x0e\x32\x37.couchbase.search.v1.SearchQueryRequest.ScanConsistency\x12\r\n\x05limit\x18\x04 \x01(\r\x12\x0c\n\x04skip\x18\x05 \x01(\r\x12\x1b\n\x13include_explanation\x18\x06 \x01(\x08\x12O\n\x0fhighlight_style\x18\x07 \x01(\x0e\x32\x36.couchbase.search.v1.SearchQueryRequest.HighlightStyle\x12\x18\n\x10highlight_fields\x18\x08 \x03(\t\x12\x0e\n\x06\x66ields\x18\t \x03(\t\x12*\n\x04sort\x18\n \x03(\x0b\x32\x1c.couchbase.search.v1.Sorting\x12\x17\n\x0f\x64isable_scoring\x18\x0b \x01(\x08\x12\x13\n\x0b\x63ollections\x18\x0c \x03(\t\x12\x19\n\x11include_locations\x18\r \x01(\x08\x12\x43\n\x06\x66\x61\x63\x65ts\x18\x0e \x03(\x0b\x32\x33.couchbase.search.v1.SearchQueryRequest.FacetsEntry\x12\x18\n\x0b\x62ucket_name\x18\x0f \x01(\tH\x00\x88\x01\x01\x12\x17\n\nscope_name\x18\x10 \x01(\tH\x01\x88\x01\x01\x1aI\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.couchbase.search.v1.Facet:\x02\x38\x01\"3\n\x0fScanConsistency\x12 \n\x1cSCAN_CONSISTENCY_NOT_BOUNDED\x10\x00\"a\n\x0eHighlightStyle\x12\x1b\n\x17HIGHLIGHT_STYLE_DEFAULT\x10\x00\x12\x18\n\x14HIGHLIGHT_STYLE_HTML\x10\x01\x12\x18\n\x14HIGHLIGHT_STYLE_ANSI\x10\x02\x42\x0e\n\x0c_bucket_nameB\r\n\x0b_scope_name\"\x9a\x13\n\x13SearchQueryResponse\x12\x45\n\x04hits\x18\x01 \x03(\x0b\x32\x37.couchbase.search.v1.SearchQueryResponse.SearchQueryRow\x12\x44\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x34.couchbase.search.v1.SearchQueryResponse.FacetsEntry\x12I\n\tmeta_data\x18\x03 \x01(\x0b\x32\x31.couchbase.search.v1.SearchQueryResponse.MetaDataH\x00\x88\x01\x01\x1a\xd9\x03\n\x0eSearchQueryRow\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x01\x12\r\n\x05index\x18\x03 \x01(\t\x12\x13\n\x0b\x65xplanation\x18\x04 \x01(\x0c\x12\x44\n\tlocations\x18\x05 \x03(\x0b\x32\x31.couchbase.search.v1.SearchQueryResponse.Location\x12Y\n\tfragments\x18\x06 \x03(\x0b\x32\x46.couchbase.search.v1.SearchQueryResponse.SearchQueryRow.FragmentsEntry\x12S\n\x06\x66ields\x18\x07 \x03(\x0b\x32\x43.couchbase.search.v1.SearchQueryResponse.SearchQueryRow.FieldsEntry\x1a\x63\n\x0e\x46ragmentsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.couchbase.search.v1.SearchQueryResponse.Fragment:\x02\x38\x01\x1a-\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1an\n\x08Location\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x0c\n\x04term\x18\x02 \x01(\t\x12\x10\n\x08position\x18\x03 \x01(\r\x12\r\n\x05start\x18\x04 \x01(\r\x12\x0b\n\x03\x65nd\x18\x05 \x01(\r\x12\x17\n\x0f\x61rray_positions\x18\x06 \x03(\r\x1a\x1b\n\x08\x46ragment\x12\x0f\n\x07\x63ontent\x18\x01 \x03(\t\x1a\xa9\x02\n\x0b\x46\x61\x63\x65tResult\x12N\n\nterm_facet\x18\x01 \x01(\x0b\x32\x38.couchbase.search.v1.SearchQueryResponse.TermFacetResultH\x00\x12Y\n\x10\x64\x61te_range_facet\x18\x02 \x01(\x0b\x32=.couchbase.search.v1.SearchQueryResponse.DateRangeFacetResultH\x00\x12_\n\x13numeric_range_facet\x18\x03 \x01(\x0b\x32@.couchbase.search.v1.SearchQueryResponse.NumericRangeFacetResultH\x00\x42\x0e\n\x0csearch_facet\x1a\x37\n\nTermResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\x0c\n\x04size\x18\x03 \x01(\x04\x1a\x99\x01\n\x0fTermFacetResult\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\r\n\x05total\x18\x03 \x01(\x03\x12\x0f\n\x07missing\x18\x04 \x01(\x03\x12\r\n\x05other\x18\x05 \x01(\x03\x12\x42\n\x05terms\x18\x06 \x03(\x0b\x32\x33.couchbase.search.v1.SearchQueryResponse.TermResultJ\x04\x08\x01\x10\x02\x1a\x81\x01\n\x0f\x44\x61teRangeResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\x12)\n\x05start\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x03\x65nd\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\xa9\x01\n\x14\x44\x61teRangeFacetResult\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\r\n\x05total\x18\x03 \x01(\x03\x12\x0f\n\x07missing\x18\x04 \x01(\x03\x12\r\n\x05other\x18\x05 \x01(\x03\x12M\n\x0b\x64\x61te_ranges\x18\x06 \x03(\x0b\x32\x38.couchbase.search.v1.SearchQueryResponse.DateRangeResultJ\x04\x08\x01\x10\x02\x1aJ\n\x12NumericRangeResult\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\x12\x0b\n\x03min\x18\x03 \x01(\x04\x12\x0b\n\x03max\x18\x04 \x01(\x04\x1a\xb2\x01\n\x17NumericRangeFacetResult\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\r\n\x05total\x18\x03 \x01(\x03\x12\x0f\n\x07missing\x18\x04 \x01(\x03\x12\r\n\x05other\x18\x05 \x01(\x03\x12S\n\x0enumeric_ranges\x18\x06 \x03(\x0b\x32;.couchbase.search.v1.SearchQueryResponse.NumericRangeResultJ\x04\x08\x01\x10\x02\x1a\xd1\x01\n\x08MetaData\x12G\n\x07metrics\x18\x01 \x01(\x0b\x32\x36.couchbase.search.v1.SearchQueryResponse.SearchMetrics\x12M\n\x06\x65rrors\x18\x02 \x03(\x0b\x32=.couchbase.search.v1.SearchQueryResponse.MetaData.ErrorsEntry\x1a-\n\x0b\x45rrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\xc8\x01\n\rSearchMetrics\x12\x31\n\x0e\x65xecution_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\ntotal_rows\x18\x02 \x01(\x04\x12\x11\n\tmax_score\x18\x03 \x01(\x01\x12\x1d\n\x15total_partition_count\x18\x04 \x01(\x04\x12\x1f\n\x17success_partition_count\x18\x05 \x01(\x04\x12\x1d\n\x15\x65rror_partition_count\x18\x06 \x01(\x04\x1a\x63\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x43\n\x05value\x18\x02 \x01(\x0b\x32\x34.couchbase.search.v1.SearchQueryResponse.FacetResult:\x02\x38\x01\x42\x0c\n\n_meta_data2u\n\rSearchService\x12\x64\n\x0bSearchQuery\x12\'.couchbase.search.v1.SearchQueryRequest\x1a(.couchbase.search.v1.SearchQueryResponse\"\x00\x30\x01\x42\xf2\x01\n+com.couchbase.client.protostellar.search.v1P\x01Z@github.com/couchbase/goprotostellar/genproto/search_v1;search_v1\xaa\x02 Couchbase.Protostellar.Search.V1\xca\x02*Couchbase\\Protostellar\\Generated\\Search\\V1\xea\x02.Couchbase::Protostellar::Generated::Search::V1b\x06proto3"
|
12
|
+
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
|
15
|
+
begin
|
16
|
+
pool.add_serialized_file(descriptor_data)
|
17
|
+
rescue TypeError => e
|
18
|
+
# Compatibility code: will be removed in the next major version.
|
19
|
+
require 'google/protobuf/descriptor_pb'
|
20
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
21
|
+
parsed.clear_dependency
|
22
|
+
serialized = parsed.class.encode(parsed)
|
23
|
+
file = pool.add_serialized_file(serialized)
|
24
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
25
|
+
imports = [
|
26
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
27
|
+
["google.protobuf.Duration", "google/protobuf/duration.proto"],
|
28
|
+
]
|
29
|
+
imports.each do |type_name, expected_filename|
|
30
|
+
import_file = pool.lookup(type_name).file_descriptor
|
31
|
+
if import_file.name != expected_filename
|
32
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
36
|
+
warn "This will become an error in the next major version."
|
37
|
+
end
|
38
|
+
|
39
|
+
module Couchbase
|
40
|
+
module Protostellar
|
41
|
+
module Generated
|
42
|
+
module Search
|
43
|
+
module V1
|
44
|
+
BooleanFieldQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.BooleanFieldQuery").msgclass
|
45
|
+
BooleanQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.BooleanQuery").msgclass
|
46
|
+
ConjunctionQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.ConjunctionQuery").msgclass
|
47
|
+
DateRangeQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.DateRangeQuery").msgclass
|
48
|
+
DisjunctionQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.DisjunctionQuery").msgclass
|
49
|
+
DocIdQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.DocIdQuery").msgclass
|
50
|
+
LatLng = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.LatLng").msgclass
|
51
|
+
GeoBoundingBoxQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.GeoBoundingBoxQuery").msgclass
|
52
|
+
GeoDistanceQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.GeoDistanceQuery").msgclass
|
53
|
+
GeoPolygonQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.GeoPolygonQuery").msgclass
|
54
|
+
MatchAllQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.MatchAllQuery").msgclass
|
55
|
+
MatchNoneQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.MatchNoneQuery").msgclass
|
56
|
+
MatchPhraseQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.MatchPhraseQuery").msgclass
|
57
|
+
MatchQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.MatchQuery").msgclass
|
58
|
+
MatchQuery::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.MatchQuery.Operator").enummodule
|
59
|
+
NumericRangeQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.NumericRangeQuery").msgclass
|
60
|
+
PhraseQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.PhraseQuery").msgclass
|
61
|
+
PrefixQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.PrefixQuery").msgclass
|
62
|
+
QueryStringQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.QueryStringQuery").msgclass
|
63
|
+
RegexpQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.RegexpQuery").msgclass
|
64
|
+
TermQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.TermQuery").msgclass
|
65
|
+
TermRangeQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.TermRangeQuery").msgclass
|
66
|
+
WildcardQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.WildcardQuery").msgclass
|
67
|
+
Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.Query").msgclass
|
68
|
+
FieldSorting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.FieldSorting").msgclass
|
69
|
+
GeoDistanceSorting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.GeoDistanceSorting").msgclass
|
70
|
+
IdSorting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.IdSorting").msgclass
|
71
|
+
ScoreSorting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.ScoreSorting").msgclass
|
72
|
+
Sorting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.Sorting").msgclass
|
73
|
+
DateRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.DateRange").msgclass
|
74
|
+
DateRangeFacet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.DateRangeFacet").msgclass
|
75
|
+
NumericRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.NumericRange").msgclass
|
76
|
+
NumericRangeFacet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.NumericRangeFacet").msgclass
|
77
|
+
TermFacet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.TermFacet").msgclass
|
78
|
+
Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.Facet").msgclass
|
79
|
+
SearchQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryRequest").msgclass
|
80
|
+
SearchQueryRequest::ScanConsistency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryRequest.ScanConsistency").enummodule
|
81
|
+
SearchQueryRequest::HighlightStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryRequest.HighlightStyle").enummodule
|
82
|
+
SearchQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse").msgclass
|
83
|
+
SearchQueryResponse::SearchQueryRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.SearchQueryRow").msgclass
|
84
|
+
SearchQueryResponse::Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.Location").msgclass
|
85
|
+
SearchQueryResponse::Fragment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.Fragment").msgclass
|
86
|
+
SearchQueryResponse::FacetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.FacetResult").msgclass
|
87
|
+
SearchQueryResponse::TermResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.TermResult").msgclass
|
88
|
+
SearchQueryResponse::TermFacetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.TermFacetResult").msgclass
|
89
|
+
SearchQueryResponse::DateRangeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.DateRangeResult").msgclass
|
90
|
+
SearchQueryResponse::DateRangeFacetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.DateRangeFacetResult").msgclass
|
91
|
+
SearchQueryResponse::NumericRangeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.NumericRangeResult").msgclass
|
92
|
+
SearchQueryResponse::NumericRangeFacetResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.NumericRangeFacetResult").msgclass
|
93
|
+
SearchQueryResponse::MetaData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.MetaData").msgclass
|
94
|
+
SearchQueryResponse::SearchMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.search.v1.SearchQueryResponse.SearchMetrics").msgclass
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: couchbase/search/v1/search.proto for package 'Couchbase.Protostellar.Generated.Search.V1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'couchbase/protostellar/generated/search/v1/search_pb'
|
6
|
+
|
7
|
+
module Couchbase
|
8
|
+
module Protostellar
|
9
|
+
module Generated
|
10
|
+
module Search
|
11
|
+
module V1
|
12
|
+
module SearchService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'couchbase.search.v1.SearchService'
|
20
|
+
|
21
|
+
rpc :SearchQuery, ::Couchbase::Protostellar::Generated::Search::V1::SearchQueryRequest, stream(::Couchbase::Protostellar::Generated::Search::V1::SearchQueryResponse)
|
22
|
+
end
|
23
|
+
|
24
|
+
Stub = Service.rpc_stub_class
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: couchbase/transactions/v1/transactions.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n,couchbase/transactions/v1/transactions.proto\x12\x19\x63ouchbase.transactions.v1\"e\n\x1eTransactionBeginAttemptRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_transaction_id\"M\n\x1fTransactionBeginAttemptResponse\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\x12\x12\n\nattempt_id\x18\x02 \x01(\t\"[\n\x18TransactionCommitRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\"\x1b\n\x19TransactionCommitResponse\"]\n\x1aTransactionRollbackRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\"\x1d\n\x1bTransactionRollbackResponse\"\x92\x01\n\x15TransactionGetRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\x12\x12\n\nscope_name\x18\x04 \x01(\t\x12\x17\n\x0f\x63ollection_name\x18\x05 \x01(\t\x12\x0b\n\x03key\x18\x06 \x01(\t\"4\n\x16TransactionGetResponse\x12\x0b\n\x03\x63\x61s\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\"\xa4\x01\n\x18TransactionInsertRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\x12\x12\n\nscope_name\x18\x04 \x01(\t\x12\x17\n\x0f\x63ollection_name\x18\x05 \x01(\t\x12\x0b\n\x03key\x18\x06 \x01(\t\x12\r\n\x05value\x18\x07 \x01(\x0c\"(\n\x19TransactionInsertResponse\x12\x0b\n\x03\x63\x61s\x18\x01 \x01(\x04\"\xb2\x01\n\x19TransactionReplaceRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\x12\x12\n\nscope_name\x18\x04 \x01(\t\x12\x17\n\x0f\x63ollection_name\x18\x05 \x01(\t\x12\x0b\n\x03key\x18\x06 \x01(\t\x12\x0b\n\x03\x63\x61s\x18\x07 \x01(\x04\x12\r\n\x05value\x18\x08 \x01(\x0c\")\n\x1aTransactionReplaceResponse\x12\x0b\n\x03\x63\x61s\x18\x01 \x01(\x04\"\xa2\x01\n\x18TransactionRemoveRequest\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x12\n\nattempt_id\x18\x03 \x01(\t\x12\x12\n\nscope_name\x18\x04 \x01(\t\x12\x17\n\x0f\x63ollection_name\x18\x05 \x01(\t\x12\x0b\n\x03key\x18\x06 \x01(\t\x12\x0b\n\x03\x63\x61s\x18\x07 \x01(\x04\"(\n\x19TransactionRemoveResponse\x12\x0b\n\x03\x63\x61s\x18\x01 \x01(\x04\x32\xbb\x07\n\x13TransactionsService\x12\x92\x01\n\x17TransactionBeginAttempt\x12\x39.couchbase.transactions.v1.TransactionBeginAttemptRequest\x1a:.couchbase.transactions.v1.TransactionBeginAttemptResponse\"\x00\x12\x80\x01\n\x11TransactionCommit\x12\x33.couchbase.transactions.v1.TransactionCommitRequest\x1a\x34.couchbase.transactions.v1.TransactionCommitResponse\"\x00\x12\x86\x01\n\x13TransactionRollback\x12\x35.couchbase.transactions.v1.TransactionRollbackRequest\x1a\x36.couchbase.transactions.v1.TransactionRollbackResponse\"\x00\x12w\n\x0eTransactionGet\x12\x30.couchbase.transactions.v1.TransactionGetRequest\x1a\x31.couchbase.transactions.v1.TransactionGetResponse\"\x00\x12\x80\x01\n\x11TransactionInsert\x12\x33.couchbase.transactions.v1.TransactionInsertRequest\x1a\x34.couchbase.transactions.v1.TransactionInsertResponse\"\x00\x12\x83\x01\n\x12TransactionReplace\x12\x34.couchbase.transactions.v1.TransactionReplaceRequest\x1a\x35.couchbase.transactions.v1.TransactionReplaceResponse\"\x00\x12\x80\x01\n\x11TransactionRemove\x12\x33.couchbase.transactions.v1.TransactionRemoveRequest\x1a\x34.couchbase.transactions.v1.TransactionRemoveResponse\"\x00\x42\x96\x02\n1com.couchbase.client.protostellar.transactions.v1P\x01ZLgithub.com/couchbase/goprotostellar/genproto/transactions_v1;transactions_v1\xaa\x02&Couchbase.Protostellar.Transactions.V1\xca\x02\x30\x43ouchbase\\Protostellar\\Generated\\Transactions\\V1\xea\x02\x34\x43ouchbase::Protostellar::Generated::Transactions::V1b\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
32
|
+
end
|
33
|
+
|
34
|
+
module Couchbase
|
35
|
+
module Protostellar
|
36
|
+
module Generated
|
37
|
+
module Transactions
|
38
|
+
module V1
|
39
|
+
TransactionBeginAttemptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionBeginAttemptRequest").msgclass
|
40
|
+
TransactionBeginAttemptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionBeginAttemptResponse").msgclass
|
41
|
+
TransactionCommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionCommitRequest").msgclass
|
42
|
+
TransactionCommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionCommitResponse").msgclass
|
43
|
+
TransactionRollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionRollbackRequest").msgclass
|
44
|
+
TransactionRollbackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionRollbackResponse").msgclass
|
45
|
+
TransactionGetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionGetRequest").msgclass
|
46
|
+
TransactionGetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionGetResponse").msgclass
|
47
|
+
TransactionInsertRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionInsertRequest").msgclass
|
48
|
+
TransactionInsertResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionInsertResponse").msgclass
|
49
|
+
TransactionReplaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionReplaceRequest").msgclass
|
50
|
+
TransactionReplaceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionReplaceResponse").msgclass
|
51
|
+
TransactionRemoveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionRemoveRequest").msgclass
|
52
|
+
TransactionRemoveResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.transactions.v1.TransactionRemoveResponse").msgclass
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: couchbase/transactions/v1/transactions.proto for package 'Couchbase.Protostellar.Generated.Transactions.V1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'couchbase/protostellar/generated/transactions/v1/transactions_pb'
|
6
|
+
|
7
|
+
module Couchbase
|
8
|
+
module Protostellar
|
9
|
+
module Generated
|
10
|
+
module Transactions
|
11
|
+
module V1
|
12
|
+
module TransactionsService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'couchbase.transactions.v1.TransactionsService'
|
20
|
+
|
21
|
+
rpc :TransactionBeginAttempt, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionBeginAttemptRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionBeginAttemptResponse
|
22
|
+
rpc :TransactionCommit, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionCommitRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionCommitResponse
|
23
|
+
rpc :TransactionRollback, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionRollbackRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionRollbackResponse
|
24
|
+
rpc :TransactionGet, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionGetRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionGetResponse
|
25
|
+
rpc :TransactionInsert, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionInsertRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionInsertResponse
|
26
|
+
rpc :TransactionReplace, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionReplaceRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionReplaceResponse
|
27
|
+
rpc :TransactionRemove, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionRemoveRequest, ::Couchbase::Protostellar::Generated::Transactions::V1::TransactionRemoveResponse
|
28
|
+
end
|
29
|
+
|
30
|
+
Stub = Service.rpc_stub_class
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: couchbase/view/v1/view.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n\x1c\x63ouchbase/view/v1/view.proto\x12\x11\x63ouchbase.view.v1\"\xa0\t\n\x10ViewQueryRequest\x12\x13\n\x0b\x62ucket_name\x18\x08 \x01(\t\x12\x1c\n\x14\x64\x65sign_document_name\x18\x01 \x01(\t\x12\x11\n\tview_name\x18\x02 \x01(\t\x12\x11\n\x04skip\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\rH\x01\x88\x01\x01\x12R\n\x10scan_consistency\x18\x05 \x01(\x0e\x32\x33.couchbase.view.v1.ViewQueryRequest.ScanConsistencyH\x02\x88\x01\x01\x12\x13\n\x06reduce\x18\x06 \x01(\x08H\x03\x88\x01\x01\x12\x12\n\x05group\x18\x07 \x01(\x08H\x04\x88\x01\x01\x12\x18\n\x0bgroup_level\x18\t \x01(\rH\x05\x88\x01\x01\x12\x10\n\x03key\x18\n \x01(\x0cH\x06\x88\x01\x01\x12\x0c\n\x04keys\x18\x0b \x03(\x0c\x12\x16\n\tstart_key\x18\x0c \x01(\x0cH\x07\x88\x01\x01\x12\x14\n\x07\x65nd_key\x18\r \x01(\x0cH\x08\x88\x01\x01\x12\x1a\n\rinclusive_end\x18\x0e \x01(\x08H\t\x88\x01\x01\x12\x1d\n\x10start_key_doc_id\x18\x0f \x01(\tH\n\x88\x01\x01\x12\x1b\n\x0e\x65nd_key_doc_id\x18\x10 \x01(\tH\x0b\x88\x01\x01\x12\x44\n\x08on_error\x18\x11 \x01(\x0e\x32-.couchbase.view.v1.ViewQueryRequest.ErrorModeH\x0c\x88\x01\x01\x12\x12\n\x05\x64\x65\x62ug\x18\x12 \x01(\x08H\r\x88\x01\x01\x12\x45\n\tnamespace\x18\x13 \x01(\x0e\x32-.couchbase.view.v1.ViewQueryRequest.NamespaceH\x0e\x88\x01\x01\x12=\n\x05order\x18\x14 \x01(\x0e\x32).couchbase.view.v1.ViewQueryRequest.OrderH\x0f\x88\x01\x01\"y\n\x0fScanConsistency\x12 \n\x1cSCAN_CONSISTENCY_NOT_BOUNDED\x10\x00\x12!\n\x1dSCAN_CONSISTENCY_REQUEST_PLUS\x10\x01\x12!\n\x1dSCAN_CONSISTENCY_UPDATE_AFTER\x10\x02\"9\n\tErrorMode\x12\x17\n\x13\x45RROR_MODE_CONTINUE\x10\x00\x12\x13\n\x0f\x45RROR_MODE_STOP\x10\x01\"@\n\tNamespace\x12\x18\n\x14NAMESPACE_PRODUCTION\x10\x00\x12\x19\n\x15NAMESPACE_DEVELOPMENT\x10\x01\"2\n\x05Order\x12\x13\n\x0fORDER_ASCENDING\x10\x00\x12\x14\n\x10ORDER_DESCENDING\x10\x01\x42\x07\n\x05_skipB\x08\n\x06_limitB\x13\n\x11_scan_consistencyB\t\n\x07_reduceB\x08\n\x06_groupB\x0e\n\x0c_group_levelB\x06\n\x04_keyB\x0c\n\n_start_keyB\n\n\x08_end_keyB\x10\n\x0e_inclusive_endB\x13\n\x11_start_key_doc_idB\x11\n\x0f_end_key_doc_idB\x0b\n\t_on_errorB\x08\n\x06_debugB\x0c\n\n_namespaceB\x08\n\x06_order\"\xfe\x01\n\x11ViewQueryResponse\x12\x36\n\x04rows\x18\x01 \x03(\x0b\x32(.couchbase.view.v1.ViewQueryResponse.Row\x12\x45\n\tmeta_data\x18\x02 \x01(\x0b\x32-.couchbase.view.v1.ViewQueryResponse.MetaDataH\x00\x88\x01\x01\x1a-\n\x03Row\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\r\n\x05value\x18\x03 \x01(\x0c\x1a-\n\x08MetaData\x12\x12\n\ntotal_rows\x18\x01 \x01(\x04\x12\r\n\x05\x64\x65\x62ug\x18\x02 \x01(\x0c\x42\x0c\n\n_meta_data2i\n\x0bViewService\x12Z\n\tViewQuery\x12#.couchbase.view.v1.ViewQueryRequest\x1a$.couchbase.view.v1.ViewQueryResponse\"\x00\x30\x01\x42\xe6\x01\n)com.couchbase.client.protostellar.view.v1P\x01Z<github.com/couchbase/goprotostellar/genproto/view_v1;view_v1\xaa\x02\x1e\x43ouchbase.Protostellar.View.V1\xca\x02(Couchbase\\Protostellar\\Generated\\View\\V1\xea\x02,Couchbase::Protostellar::Generated::View::V1b\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
32
|
+
end
|
33
|
+
|
34
|
+
module Couchbase
|
35
|
+
module Protostellar
|
36
|
+
module Generated
|
37
|
+
module View
|
38
|
+
module V1
|
39
|
+
ViewQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryRequest").msgclass
|
40
|
+
ViewQueryRequest::ScanConsistency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryRequest.ScanConsistency").enummodule
|
41
|
+
ViewQueryRequest::ErrorMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryRequest.ErrorMode").enummodule
|
42
|
+
ViewQueryRequest::Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryRequest.Namespace").enummodule
|
43
|
+
ViewQueryRequest::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryRequest.Order").enummodule
|
44
|
+
ViewQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryResponse").msgclass
|
45
|
+
ViewQueryResponse::Row = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryResponse.Row").msgclass
|
46
|
+
ViewQueryResponse::MetaData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("couchbase.view.v1.ViewQueryResponse.MetaData").msgclass
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: couchbase/view/v1/view.proto for package 'Couchbase.Protostellar.Generated.View.V1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'couchbase/protostellar/generated/view/v1/view_pb'
|
6
|
+
|
7
|
+
module Couchbase
|
8
|
+
module Protostellar
|
9
|
+
module Generated
|
10
|
+
module View
|
11
|
+
module V1
|
12
|
+
module ViewService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'couchbase.view.v1.ViewService'
|
20
|
+
|
21
|
+
rpc :ViewQuery, ::Couchbase::Protostellar::Generated::View::V1::ViewQueryRequest, stream(::Couchbase::Protostellar::Generated::View::V1::ViewQueryResponse)
|
22
|
+
end
|
23
|
+
|
24
|
+
Stub = Service.rpc_stub_class
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# Copyright 2023. Couchbase, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
# frozen_string_literal: true
|
16
|
+
|
17
|
+
require "couchbase/management/bucket_manager"
|
18
|
+
require "couchbase/options"
|
19
|
+
|
20
|
+
require_relative "../request_generator/admin/bucket"
|
21
|
+
require_relative "../response_converter/admin/bucket"
|
22
|
+
|
23
|
+
module Couchbase
|
24
|
+
module Protostellar
|
25
|
+
module Management
|
26
|
+
class BucketManager
|
27
|
+
def initialize(client)
|
28
|
+
@client = client
|
29
|
+
@request_generator = RequestGenerator::Admin::Bucket.new
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_bucket(settings, options = Couchbase::Management::Options::Bucket::CreateBucket.new)
|
33
|
+
req = @request_generator.create_bucket_request(settings, options)
|
34
|
+
@client.send_request(req)
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_bucket(settings, options = Couchbase::Management::Options::Bucket::UpdateBucket.new)
|
38
|
+
req = @request_generator.update_bucket_request(settings, options)
|
39
|
+
@client.send_request(req)
|
40
|
+
end
|
41
|
+
|
42
|
+
def drop_bucket(settings, options = Couchbase::Management::Options::Bucket::DropBucket.new)
|
43
|
+
req = @request_generator.delete_bucket_request(settings, options)
|
44
|
+
@client.send_request(req)
|
45
|
+
end
|
46
|
+
|
47
|
+
def get_all_buckets(options = Couchbase::Management::Options::Bucket::GetAllBuckets.new)
|
48
|
+
req = @request_generator.list_buckets_request(options)
|
49
|
+
resp = @client.send_request(req)
|
50
|
+
ResponseConverter::Admin::Bucket.to_bucket_settings_array(resp)
|
51
|
+
end
|
52
|
+
|
53
|
+
def get_bucket(bucket_name, options = Couchbase::Management::Options::Bucket::GetBucket.new)
|
54
|
+
buckets = get_all_buckets(options)
|
55
|
+
bucket = buckets.find { |b| b.name == bucket_name }
|
56
|
+
raise Couchbase::Error::BucketNotFound, "Could not find bucket '#{bucket_name}'" if bucket.nil?
|
57
|
+
|
58
|
+
bucket
|
59
|
+
end
|
60
|
+
|
61
|
+
def flush_bucket(_bucket_name, _options = Couchbase::Management::Options::Bucket::FlushBucket.new)
|
62
|
+
raise Couchbase::Error::FeatureNotAvailable, "The #{Protostellar::NAME} protocol does not support flush_bucket yet"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# Copyright 2023. Couchbase, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
# frozen_string_literal: true
|
16
|
+
|
17
|
+
require "couchbase/management/collection_manager"
|
18
|
+
|
19
|
+
require_relative "../request_generator/admin/collection"
|
20
|
+
require_relative "../response_converter/admin/collection"
|
21
|
+
|
22
|
+
module Couchbase
|
23
|
+
module Protostellar
|
24
|
+
module Management
|
25
|
+
class CollectionManager
|
26
|
+
def initialize(client:, bucket_name:)
|
27
|
+
@client = client
|
28
|
+
@bucket_name = bucket_name
|
29
|
+
@request_generator = RequestGenerator::Admin::Collection.new(bucket_name: @bucket_name)
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_all_scopes(options = Couchbase::Management::Options::Collection::GetAllScopes.new)
|
33
|
+
req = @request_generator.list_collections_request(options)
|
34
|
+
resp = @client.send_request(req)
|
35
|
+
ResponseConverter::Admin::Collection.to_scope_spec_array(resp)
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_scope(scope_name, options = Couchbase::Management::Options::Collection::CreateScope.new)
|
39
|
+
req = @request_generator.create_scope_request(scope_name, options)
|
40
|
+
@client.send_request(req)
|
41
|
+
end
|
42
|
+
|
43
|
+
def drop_scope(scope_name, options = Couchbase::Management::Options::Collection::DropScope.new)
|
44
|
+
req = @request_generator.delete_scope_request(scope_name, options)
|
45
|
+
@client.send_request(req)
|
46
|
+
end
|
47
|
+
|
48
|
+
def create_collection(*args)
|
49
|
+
req =
|
50
|
+
if args[0].is_a?(Couchbase::Management::CollectionSpec)
|
51
|
+
collection = args[0]
|
52
|
+
options = args[1] || Couchbase::Management::Options::Collection::CreateCollection::DEFAULT
|
53
|
+
settings = Couchbase::Management::CreateCollectionSettings.new(max_expiry: collection.max_expiry, history: collection.history)
|
54
|
+
|
55
|
+
warn "Calling create_collection with a CollectionSpec object has been deprecated, supply scope name, " \
|
56
|
+
"collection name and optionally a CreateCollectionSettings instance"
|
57
|
+
|
58
|
+
@request_generator.create_collection_request(collection.scope_name, collection.name, settings, options)
|
59
|
+
else
|
60
|
+
scope_name = args[0]
|
61
|
+
collection_name = args[1]
|
62
|
+
settings = args[2] || Couchbase::Management::CreateCollectionSettings::DEFAULT
|
63
|
+
options = args[3] || Couchbase::Management::Options::Collection::CreateCollection::DEFAULT
|
64
|
+
@request_generator.create_collection_request(scope_name, collection_name, settings, options)
|
65
|
+
end
|
66
|
+
@client.send_request(req)
|
67
|
+
end
|
68
|
+
|
69
|
+
def drop_collection(*args)
|
70
|
+
req =
|
71
|
+
if args[0].is_a?(Couchbase::Management::CollectionSpec)
|
72
|
+
collection = args[0]
|
73
|
+
options = args[1] || Couchbase::Management::Options::Collection::CreateCollection::DEFAULT
|
74
|
+
|
75
|
+
warn "Calling drop_collection with a CollectionSpec object has been deprecated, supply scope name and collection name"
|
76
|
+
|
77
|
+
@request_generator.delete_collection_request(collection.scope_name, collection.name, options)
|
78
|
+
else
|
79
|
+
scope_name = args[0]
|
80
|
+
collection_name = args[1]
|
81
|
+
options = args[2] || Couchbase::Management::Options::Collection::CreateCollection::DEFAULT
|
82
|
+
@request_generator.delete_collection_request(scope_name, collection_name, options)
|
83
|
+
end
|
84
|
+
@client.send_request(req)
|
85
|
+
end
|
86
|
+
|
87
|
+
def update_collection(_scope_name, _collection_name, _settings = UpdateCollectionSettings::DEFAULT,
|
88
|
+
_options = Couchbase::Management::Options::Collection::UpdateCollection::DEFAULT)
|
89
|
+
raise Couchbase::Error::FeatureNotAvailable, "The #{Protostellar::NAME} protocol does not support update_collection"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|