Sha256: 97dfb78e0adc61295ea62c572510ff9242960f783806cf780ef5a8d50fced006

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *   Copyright 2020-2021 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#include "cluster_options.hxx"
#include "config_profile.hxx"
#include <stdexcept>

namespace couchbase::core
{

std::chrono::milliseconds
cluster_options::default_timeout_for(service_type type) const
{
    switch (type) {
        case service_type::key_value:
            return key_value_timeout;
        case service_type::query:
            return query_timeout;
        case service_type::analytics:
            return analytics_timeout;
        case service_type::search:
            return search_timeout;
        case service_type::view:
            return view_timeout;
        case service_type::management:
        case service_type::eventing:
            return management_timeout;
    }
    throw std::runtime_error("unexpected service type");
}
void
cluster_options::apply_profile(std::string profile_name)
{
    couchbase::core::known_profiles().apply(profile_name, *this);
}
} // namespace couchbase::core

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
couchbase-3.4.2 ext/couchbase/core/cluster_options.cxx
couchbase-3.4.1 ext/couchbase/core/cluster_options.cxx
couchbase-3.4.0 ext/couchbase/core/cluster_options.cxx