Skip to content

Commit

Permalink
Rename Address back to BindAddress
Browse files Browse the repository at this point in the history
Now it is only being used as a bind address
  • Loading branch information
adam-fowler committed May 16, 2024
1 parent ded1991 commit 075227f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Sources/Hummingbird/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct ApplicationConfiguration: Sendable {
// MARK: Member variables

/// Bind address for server
public var address: Address
public var address: BindAddress
/// Server name to return in "server" header
public var serverName: String?
/// Defines the maximum length for the queue of pending connections
Expand All @@ -49,7 +49,7 @@ public struct ApplicationConfiguration: Sendable {
/// the client may receive an error with an indication of ECONNREFUSE
/// - reuseAddress: Allows socket to be bound to an address that is already in use.
public init(
address: Address = .hostname(),
address: BindAddress = .hostname(),
serverName: String? = nil,
backlog: Int = 256,
reuseAddress: Bool = true
Expand All @@ -72,7 +72,7 @@ public struct ApplicationConfiguration: Sendable {
/// - reuseAddress: Allows socket to be bound to an address that is already in use.
/// - tlsOptions: TLS options for when you are using NIOTransportServices
public init(
address: Address = .hostname(),
address: BindAddress = .hostname(),
serverName: String? = nil,
reuseAddress: Bool = true,
tlsOptions: TSTLSOptions
Expand All @@ -88,7 +88,7 @@ public struct ApplicationConfiguration: Sendable {

/// Create new configuration struct with updated values
public func with(
address: Address? = nil,
address: BindAddress? = nil,
serverName: String? = nil,
backlog: Int? = nil,
reuseAddress: Bool? = nil
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hummingbird/Exports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

@_exported import struct HummingbirdCore.Address
@_exported import struct HummingbirdCore.BindAddress
@_exported import struct HummingbirdCore.HTTPError
@_exported import protocol HummingbirdCore.HTTPResponseError
@_exported import struct HummingbirdCore.Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

/// Address to bind server to
public struct Address: Sendable, Equatable {
public struct BindAddress: Sendable, Equatable {
enum _Internal: Equatable {
case hostname(_ host: String = "127.0.0.1", port: Int = 8080)
case unixDomainSocket(path: String)
Expand Down
6 changes: 3 additions & 3 deletions Sources/HummingbirdCore/Server/ServerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import NIOCore
/// HTTP server configuration
public struct ServerConfiguration: Sendable {
/// Bind address for server
public let address: Address
public let address: BindAddress
/// Server name to return in "server" header
public let serverName: String?
/// Defines the maximum length for the queue of pending connections
Expand All @@ -37,7 +37,7 @@ public struct ServerConfiguration: Sendable {
/// the client may receive an error with an indication of ECONNREFUSE
/// - reuseAddress: Allows socket to be bound to an address that is already in use.
public init(
address: Address = .hostname(),
address: BindAddress = .hostname(),
serverName: String? = nil,
backlog: Int = 256,
reuseAddress: Bool = true
Expand All @@ -61,7 +61,7 @@ public struct ServerConfiguration: Sendable {
/// - tlsOptions: TLS options for when you are using NIOTransportServices
#if canImport(Network)
public init(
address: Address = .hostname(),
address: BindAddress = .hostname(),
serverName: String? = nil,
backlog: Int = 256,
reuseAddress: Bool = true,
Expand Down

0 comments on commit 075227f

Please sign in to comment.