forked from simple-db/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project (photon) | ||
|
||
include_directories(./src) | ||
|
||
aux_source_directory(./src SRCS) | ||
|
||
link_libraries(brpc protobuf gflags leveldb pthread ssl crypto dl rt) | ||
|
||
add_definitions(-std=c++11 -static) | ||
|
||
add_executable(photon ${SRCS}) | ||
|
||
add_custom_target(output command echo "hello") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package photon | ||
|
||
option cc_generic_services = true; | ||
|
||
message Key { | ||
optional bytes key = 1; | ||
}; | ||
|
||
message KeySet { | ||
repeated bytes keys = 1; | ||
}; | ||
|
||
message Value { | ||
optional bytes value = 1; | ||
}; | ||
|
||
message ValueSet { | ||
repeated bytes values = 1; | ||
}; | ||
|
||
message Record { | ||
optional bytes key = 1; | ||
optional bytes value = 2; | ||
}; | ||
|
||
message RecordSet { | ||
repeated bytes keys = 1; | ||
repeated bytes values = 2; | ||
}; | ||
|
||
message Status { | ||
optional int32 ret = 1; | ||
optional string msg = 2; | ||
optional Value value = 3; | ||
}; | ||
|
||
message StatusSet { | ||
optional int32 ret = 1; | ||
optional string msg = 2; | ||
repeated Status statuses = 3; | ||
}; | ||
|
||
rpc PhotonDBService { | ||
rpc get(Key) returns(Status) | ||
rpc mget(KeySet) returns(StatusSet) | ||
rpc set(Record) returns(Status) | ||
rpc mset(RecordSet) returns(StatusSet) | ||
}; | ||
|
||
rpc PhotonCMDService { | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//********************************************************** | ||
// File: table.h | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#pragma once | ||
|
||
namespace photon { | ||
|
||
class Entry { | ||
}; // class Entry | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//********************************************************** | ||
// File: error.h | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
namespace photon { | ||
|
||
enum class ErrorCode { | ||
|
||
}; // enum class ErrorCode | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//********************************************************** | ||
// File: main.cpp | ||
// Author: [email protected] | ||
// Description: Main Entry of Photon | ||
//********************************************************** | ||
|
||
#include <gflags/gflags.h> | ||
|
||
namespace photon { | ||
|
||
int run(int argc, char** argv) { | ||
google::ParseCommandLineFlags(&argc, &argv, true); | ||
|
||
return 0; | ||
} | ||
|
||
} // namespace photon | ||
|
||
int main(int argc, char** argv) { | ||
return ::photon::run(argc, argv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//********************************************************** | ||
// File: options.h | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#pragma once | ||
|
||
namespace photon { | ||
|
||
class Options { | ||
}; // class Options | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//********************************************************** | ||
// File: segment.cpp | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#include "segment.h" | ||
|
||
namespace photon { | ||
|
||
Segment::Segment() { | ||
} | ||
|
||
Segment::~Segment() { | ||
} | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//********************************************************** | ||
// File: segment.h | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#pragma once | ||
|
||
namespace photon { | ||
|
||
class Segment { | ||
public: | ||
Segment(); | ||
|
||
~Segment(); | ||
}; // class Segment | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//********************************************************** | ||
// File: service.h | ||
// Author: [email protected] | ||
// Description: Main Entry of Photon | ||
//********************************************************** | ||
|
||
#pragma once | ||
|
||
namespace photon { | ||
|
||
class Service { | ||
public: | ||
Service(); | ||
|
||
~Service(); | ||
|
||
int start(); | ||
|
||
int stop(); | ||
|
||
int join(); | ||
}; // class Service | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//********************************************************** | ||
// File: table.cpp | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#include "table.h" | ||
|
||
namespace photon { | ||
|
||
Table::Table() { | ||
} | ||
|
||
Table::~Table() { | ||
} | ||
|
||
} // namespace photon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//********************************************************** | ||
// File: table.h | ||
// Author: [email protected] | ||
// Description: | ||
//********************************************************** | ||
|
||
#pragma once | ||
|
||
namespace photon { | ||
|
||
class Table { | ||
public: | ||
Table(); | ||
|
||
~Table(); | ||
}; // class Table | ||
|
||
} // namespace photon |