Skip to content

Commit

Permalink
Merge pull request #44 from kirilltitov/make-api-public-again
Browse files Browse the repository at this point in the history
Make API public again (AKA the "God I'm an idiot" initiative)
  • Loading branch information
kirilltitov committed Apr 11, 2019
2 parents 4b5b99c + 82b4fdd commit 7fcda09
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Sources/FDB/FDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class FDB {
}

/// Performs an explicit disconnect routine.
func disconnect() {
public func disconnect() {
if !self.isConnected {
FDB.logger.error("Trying to disconnect from FDB while not connected")
return
Expand Down Expand Up @@ -192,7 +192,7 @@ public class FDB {
}

/// Performs explicit connection to FDB cluster
func connect() throws {
public func connect() throws {
_ = try self.getDB()
FDB.logger.debug("Connected")
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/FDB/FDB/FDB+Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public extension FDB {
typealias Errno = fdb_error_t
}

extension FDB.Errno {
internal extension FDB.Errno {
/// Converts non-zero error number to throwable error
func orThrow() throws {
if self == 0 {
Expand Down Expand Up @@ -263,7 +263,7 @@ public extension FDB {
}

/// Returns human-readable description of current FDB error
func getDescription() -> String {
public func getDescription() -> String {
if self.errno == 8000 {
return "You should replay this transaction"
}
Expand Down
16 changes: 8 additions & 8 deletions Sources/FDB/Transaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public extension FDB {
}

/// Destroys current transaction. It becomes unusable after this.
func destroy() {
public func destroy() {
fdb_transaction_destroy(self.pointer)
}

Expand Down Expand Up @@ -61,14 +61,14 @@ public extension FDB {

/// Cancels the transaction. All pending or future uses of the transaction will return
/// a `transaction_cancelled` error. The transaction can be used again after it is `reset`.
func cancel() {
public func cancel() {
self.log("Cancelling transaction")
fdb_transaction_cancel(self.pointer)
}

/// Reset transaction to its initial state.
/// This is similar to creating a new transaction after destroying previous one.
func reset() {
public func reset() {
self.log("Resetting transaction")
fdb_transaction_reset(self.pointer)
}
Expand All @@ -77,7 +77,7 @@ public extension FDB {
///
/// - parameters:
/// - key: FDB key
func clear(key: AnyFDBKey) {
public func clear(key: AnyFDBKey) {
let keyBytes = key.asFDBKey()
fdb_transaction_clear(self.pointer, keyBytes, keyBytes.length)
}
Expand All @@ -87,7 +87,7 @@ public extension FDB {
/// - parameters:
/// - begin: Begin key
/// - end: End key
func clear(begin: AnyFDBKey, end: AnyFDBKey) {
public func clear(begin: AnyFDBKey, end: AnyFDBKey) {
let beginBytes = begin.asFDBKey()
let endBytes = end.asFDBKey()
fdb_transaction_clear_range(self.pointer, beginBytes, beginBytes.length, endBytes, endBytes.length)
Expand All @@ -97,7 +97,7 @@ public extension FDB {
///
/// - parameters:
/// - range: Range key
func clear(range: FDB.RangeKey) {
public func clear(range: FDB.RangeKey) {
self.clear(begin: range.begin, end: range.end)
}

Expand All @@ -108,7 +108,7 @@ public extension FDB {
/// - _: Atomic operation
/// - key: FDB key
/// - value: Value bytes
func atomic(_ op: FDB.MutationType, key: AnyFDBKey, value: Bytes) {
public func atomic(_ op: FDB.MutationType, key: AnyFDBKey, value: Bytes) {
let keyBytes = key.asFDBKey()
fdb_transaction_atomic_op(
self.pointer,
Expand All @@ -126,7 +126,7 @@ public extension FDB {
/// with error_code_past_version; if it is too new, subsequent reads may be delayed indefinitely and/or fail
/// with error_code_future_version. If any of fdb_transaction_get_*() have been called
/// on this transaction already, the result is undefined.
func setReadVersion(version: Int64) {
public func setReadVersion(version: Int64) {
fdb_transaction_set_read_version(self.pointer, version)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/FDB/Transaction/Transaction+NIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import CFDB
import NIO

internal extension EventLoopFuture {
func checkingRetryableError(for transaction: FDB.Transaction) -> EventLoopFuture {
@usableFromInline func checkingRetryableError(for transaction: FDB.Transaction) -> EventLoopFuture {
return self.flatMapError { error in
guard let FDBError = error as? FDB.Error else {
return self.eventLoop.makeFailedFuture(error)
Expand Down

0 comments on commit 7fcda09

Please sign in to comment.