diff --git a/src/raft.nim b/libs/raft.nim similarity index 100% rename from src/raft.nim rename to libs/raft.nim diff --git a/src/raft/consensus_state_machine.nim b/libs/raft/consensus_state_machine.nim similarity index 99% rename from src/raft/consensus_state_machine.nim rename to libs/raft/consensus_state_machine.nim index 6be96ae..a03276b 100644 --- a/src/raft/consensus_state_machine.nim +++ b/libs/raft/consensus_state_machine.nim @@ -13,7 +13,6 @@ import tracker import state import std/[times] -import std/sequtils import std/random diff --git a/src/raft/log.nim b/libs/raft/log.nim similarity index 100% rename from src/raft/log.nim rename to libs/raft/log.nim diff --git a/src/raft/rlock.nim b/libs/raft/rlock.nim similarity index 100% rename from src/raft/rlock.nim rename to libs/raft/rlock.nim diff --git a/src/raft/state.nim b/libs/raft/state.nim similarity index 100% rename from src/raft/state.nim rename to libs/raft/state.nim diff --git a/src/raft/tracker.nim b/libs/raft/tracker.nim similarity index 97% rename from src/raft/tracker.nim rename to libs/raft/tracker.nim index 25248a3..e4b8715 100644 --- a/src/raft/tracker.nim +++ b/libs/raft/tracker.nim @@ -1,5 +1,4 @@ import types -import std/sequtils import std/[times] type diff --git a/src/raft/types.nim b/libs/raft/types.nim similarity index 100% rename from src/raft/types.nim rename to libs/raft/types.nim diff --git a/raft.nimble b/raft.nimble index 61ce7c0..a7dd11c 100644 --- a/raft.nimble +++ b/raft.nimble @@ -14,7 +14,7 @@ version = "0.0.1" author = "Status Research & Development GmbH" description = "raft consensus in nim" license = "Apache License 2.0" -srcDir = "src" +srcDir = "libs" installExt = @["nim"] skipDirs = @["tests"] bin = @["raft"] diff --git a/raft.nims b/raft.nims index 64f3bc5..e1b6043 100644 --- a/raft.nims +++ b/raft.nims @@ -12,7 +12,7 @@ proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") = task build, "Build static lib": - buildLibrary "nim-raft", "src/raft/" + buildLibrary "nim-raft", "libs/raft/" task test, "Run tests": exec "nim c -r tests/test_consensus_state_machine.nim " diff --git a/tests/test_consensus_state_machine.nim b/tests/test_consensus_state_machine.nim index e7087dc..76b1147 100644 --- a/tests/test_consensus_state_machine.nim +++ b/tests/test_consensus_state_machine.nim @@ -8,11 +8,11 @@ # those terms. import unittest2 -import ../src/raft/types -import ../src/raft/consensus_state_machine -import ../src/raft/log -import ../src/raft/tracker -import ../src/raft/state +import ../libs/raft/types +import ../libs/raft/consensus_state_machine +import ../libs/raft/log +import ../libs/raft/tracker +import ../libs/raft/state import std/[times, sequtils] import uuids import tables