|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the swift-kafka-gsoc open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2022 Apple Inc. and the swift-kafka-gsoc project authors |
| 6 | +// Licensed under Apache License v2.0 |
| 7 | +// |
| 8 | +// See LICENSE.txt for license information |
| 9 | +// See CONTRIBUTORS.txt for the list of swift-kafka-gsoc project authors |
| 10 | +// |
| 11 | +// SPDX-License-Identifier: Apache-2.0 |
| 12 | +// |
| 13 | +//===----------------------------------------------------------------------===// |
| 14 | + |
| 15 | +/// Collection of `enum` types used in the configuration structs this library provides. |
| 16 | +public struct ConfigEnums { |
| 17 | + /// Available debug contexts to enable. |
| 18 | + public struct DebugOption: Hashable, Equatable, CustomStringConvertible { |
| 19 | + public let description: String |
| 20 | + |
| 21 | + public static let generic = DebugOption(description: "generic") |
| 22 | + public static let broker = DebugOption(description: "broker") |
| 23 | + public static let topic = DebugOption(description: "topic") |
| 24 | + public static let metadata = DebugOption(description: "metadata") |
| 25 | + public static let feature = DebugOption(description: "feature") |
| 26 | + public static let queue = DebugOption(description: "queue") |
| 27 | + public static let msg = DebugOption(description: "msg") |
| 28 | + public static let `protocol` = DebugOption(description: "protocol") |
| 29 | + public static let cgrp = DebugOption(description: "cgrp") |
| 30 | + public static let security = DebugOption(description: "security") |
| 31 | + public static let fetch = DebugOption(description: "fetch") |
| 32 | + public static let interceptor = DebugOption(description: "interceptor") |
| 33 | + public static let plugin = DebugOption(description: "plugin") |
| 34 | + public static let consumer = DebugOption(description: "consumer") |
| 35 | + public static let admin = DebugOption(description: "admin") |
| 36 | + public static let eos = DebugOption(description: "eos") |
| 37 | + public static let all = DebugOption(description: "all") |
| 38 | + } |
| 39 | + |
| 40 | + /// Available IP address families. |
| 41 | + public struct IPAddressFamily: Hashable, Equatable, CustomStringConvertible { |
| 42 | + public let description: String |
| 43 | + |
| 44 | + /// Use any IP address family. |
| 45 | + public static let any = IPAddressFamily(description: "any") |
| 46 | + /// Use the IPv4 address family. |
| 47 | + public static let v4 = IPAddressFamily(description: "v4") |
| 48 | + /// Use the IPv6 address family. |
| 49 | + public static let v6 = IPAddressFamily(description: "v6") |
| 50 | + } |
| 51 | + |
| 52 | + /// Protocol used to communicate with brokers. |
| 53 | + public struct SecurityProtocol: Hashable, Equatable, CustomStringConvertible { |
| 54 | + public let description: String |
| 55 | + |
| 56 | + /// Send messages as plaintext (no security protocol used). |
| 57 | + public static let plaintext = SecurityProtocol(description: "plaintext") |
| 58 | + /// Use the Secure Sockets Layer (SSL) protocol. |
| 59 | + public static let ssl = SecurityProtocol(description: "ssl") |
| 60 | + /// Use the Simple Authentication and Security Layer (SASL). |
| 61 | + public static let saslPlaintext = SecurityProtocol(description: "sasl_plaintext") |
| 62 | + /// Use the Simple Authentication and Security Layer (SASL) with SSL. |
| 63 | + public static let saslSSL = SecurityProtocol(description: "sasl_ssl") |
| 64 | + } |
| 65 | + |
| 66 | + /// Available SASL mechanisms that can be used for authentication. |
| 67 | + public struct SASLMechanism: Hashable, Equatable, CustomStringConvertible { |
| 68 | + public let description: String |
| 69 | + |
| 70 | + /// Use the GSSAPI mechanism. |
| 71 | + public static let gssapi = SASLMechanism(description: "GSSAPI") |
| 72 | + /// Use the PLAIN mechanism. |
| 73 | + public static let plain = SASLMechanism(description: "PLAIN") |
| 74 | + /// Use the SCRAM-SHA-256 mechanism. |
| 75 | + public static let scramSHA256 = SASLMechanism(description: "SCRAM-SHA-256") |
| 76 | + /// Use the SCRAM-SHA-512 mechanism. |
| 77 | + public static let scramSHA512 = SASLMechanism(description: "SCRAM-SHA-512") |
| 78 | + /// Use the OAUTHBEARER mechanism. |
| 79 | + public static let oauthbearer = SASLMechanism(description: "OAUTHBEARER") |
| 80 | + } |
| 81 | +} |
0 commit comments