diff --git a/README.md b/README.md index 5338dc3..41c488d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Declarative URL routing in swift Here is an example of the Router for some back-end `API`: ```swift -struct Api: RouterType { +struct Api: EndpointType { enum Environment: EnvironmentType { case localhost case test @@ -56,7 +56,7 @@ print(Router(.production, at: .posts(for: Date())).url) // https://myproduc It can often happen, that you will be using some third-party `API` and you will have only access to Production environment. So in this case your Router will look something like this: ```swift -struct Auth: RouterType { +struct Auth: EndpointType { enum Route: RouteType { case signIn, signOut diff --git a/SweetRouter/Router.swift b/SweetRouter/Router.swift index ddcd9c2..b7d6cb2 100644 --- a/SweetRouter/Router.swift +++ b/SweetRouter/Router.swift @@ -8,7 +8,7 @@ import Foundation -public struct Router: URLRepresentable { +public struct Router: URLRepresentable { public let environment: T.Environment public let route: T.Route @@ -40,7 +40,7 @@ public extension URLRepresentable { } } -public protocol RouterType { +public protocol EndpointType { associatedtype Environment: EnvironmentType associatedtype Route: RouteType diff --git a/SweetRouterTests/TestRouter.swift b/SweetRouterTests/TestRouter.swift index 846a102..57dff10 100644 --- a/SweetRouterTests/TestRouter.swift +++ b/SweetRouterTests/TestRouter.swift @@ -9,7 +9,7 @@ import XCTest import SweetRouter -struct Api: RouterType { +struct Api: EndpointType { enum Environment: EnvironmentType { case localhost case test @@ -41,7 +41,7 @@ struct Api: RouterType { static let `default`: Environment = .localhost } -struct Auth: RouterType { +struct Auth: EndpointType { enum Route: RouteType { case signIn, signOut