iceberg-cpp
Loading...
Searching...
No Matches
rest_util.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <string>
26#include <string_view>
27#include <unordered_map>
28#include <unordered_set>
29
33#include "iceberg/result.h"
34#include "iceberg/type_fwd.h"
35
36namespace iceberg::rest {
37
42ICEBERG_REST_EXPORT std::string_view TrimTrailingSlash(std::string_view str);
43
52ICEBERG_REST_EXPORT Result<std::string> EncodeString(std::string_view str_to_encode);
53
60ICEBERG_REST_EXPORT Result<std::string> DecodeString(std::string_view str_to_decode);
61
70 const Namespace& ns_to_encode, std::string_view separator = "%1F");
71
79ICEBERG_REST_EXPORT Result<Namespace> DecodeNamespace(std::string_view str_to_decode,
80 std::string_view separator = "%1F");
81
90ICEBERG_REST_EXPORT std::unordered_map<std::string, std::string> MergeConfigs(
91 const std::unordered_map<std::string, std::string>& server_defaults,
92 const std::unordered_map<std::string, std::string>& client_configs,
93 const std::unordered_map<std::string, std::string>& server_overrides);
94
102ICEBERG_REST_EXPORT std::string GetStandardReasonPhrase(int32_t status_code);
103
104} // namespace iceberg::rest
Define symbol visibility macros for the REST catalog library.
REST catalog APIs.
Definition auth_manager.h:34
ICEBERG_REST_EXPORT std::unordered_map< std::string, std::string > MergeConfigs(const std::unordered_map< std::string, std::string > &server_defaults, const std::unordered_map< std::string, std::string > &client_configs, const std::unordered_map< std::string, std::string > &server_overrides)
Merge catalog configuration properties.
ICEBERG_REST_EXPORT Result< std::string > EncodeNamespace(const Namespace &ns_to_encode, std::string_view separator="%1F")
Encode a Namespace into a URL-safe component.
ICEBERG_REST_EXPORT Result< std::string > EncodeString(std::string_view str_to_encode)
URL-encode a string (RFC 3986).
ICEBERG_REST_EXPORT Result< Namespace > DecodeNamespace(std::string_view str_to_decode, std::string_view separator="%1F")
Decode a URL-encoded namespace string back to a Namespace.
ICEBERG_REST_EXPORT std::string GetStandardReasonPhrase(int32_t status_code)
Get the standard HTTP reason phrase for a status code.
ICEBERG_REST_EXPORT std::string_view TrimTrailingSlash(std::string_view str)
Trim trailing slashes from a string.
ICEBERG_REST_EXPORT Result< std::string > DecodeString(std::string_view str_to_decode)
URL-decode a string.
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
A namespace in a catalog.
Definition table_identifier.h:35