Skip to content

Commit 100feed

Browse files
authored
Merge pull request #4 from IBM-Swift/improve_README
improve README
2 parents 3f40f5b + eefe57a commit 100feed

3 files changed

Lines changed: 55 additions & 9 deletions

File tree

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1-
# SwiftConfiguration
1+
# CloudConfiguration
22

3+
The write once, run anywhere configuration library. Designed to be a platform agnostic way to automatically
4+
configuring connections to your hosting services.
35

4-
Currently supports Cloudant, Redis, PostgreSQL, MongoDB, MySQL, and DB2.
6+
## Platforms:
7+
8+
- Bluemix
9+
- Heroku (future)
10+
- Amazon AWS (future)
11+
12+
## Supported services:
13+
14+
- Cloudant
15+
- Redis
16+
- PostgreSQL
17+
- MongoDB
18+
- MySQL
519

620
## Basic Usage:
721

822
```swift
923
let manager = ConfigurationManager()
1024

11-
do {
12-
try manager.load(.EnvironmentVariables)
13-
.load(file: "config.json")
14-
15-
let cloudantService = try manager.getCloudantService(name: "MyCloudantDB")
16-
} catch {
25+
let mongoDBService = try manager.getMongoDBService()
26+
27+
mongoDBService.username
28+
mongoDBService.password
29+
mongoDBService.hostname
30+
mongoDBService.port
1731

18-
}
1932
```
33+

Tests/CloudFoundryConfigTests/FileLoadTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright IBM Corporation 2017
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import XCTest
218

319
import Configuration

Tests/LinuxMain.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright IBM Corporation 2017
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import XCTest
218
@testable import CloudFoundryConfigTests
319

0 commit comments

Comments
 (0)