Bloombox/Swift

View on GitHub
Sources/Client/RemoteService.swift

Summary

Maintainability
A
0 mins
Test Coverage
/**
* Copyright 2019, Momentum Ideas, Co. All rights reserved.
* Source and object computer code contained herein is the private intellectual
* property of Momentum Ideas Co., a Delaware Corporation. Use of this
* code in source form requires permission in writing before use or the
* assembly, distribution, or publishing of derivative works, for commercial
* purposes or any other purpose, from a duly authorized officer of Momentum
* Ideas Co.
*
* 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.
**/

import Foundation


/// Basic client-side logic protocol. Simply specifies a `prepare` function that is dispatched early in client
/// initialization flow to ready any necessary stuff before the library operates.
internal protocol ClientLogic {
  /// Prepare this object for use.
  func prepare()
}


///
///
extension RemoteService {
  ///
  ///
  func prepare() {
    /* no-op */
  }

}


/// Specifies a remotely-supported service. Complies with `ClientLogic` so that it may be prepared early in the
/// execution flow. Also supports a name for logging.
internal protocol RemoteService: ClientLogic {
  /// Specify a simple string name for this remote service. Used for debugging, logging, and other basic operations.
  var name: String { get }

  /// Specifies the named version of this service with which we intend to communicate.
  var version: String { get }

  /// Specifies a mount point for client-wide settings.
  var settings: Bloombox.Settings { get }
}