-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
实现使用rpc进行节点间获取缓存;并使用etcd实现缓存服务的注册与发现;节点间通信使用protobuf格式
- Loading branch information
1 parent
f24a9b4
commit caa27cb
Showing
16 changed files
with
978 additions
and
170 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 |
---|---|---|
|
@@ -7,3 +7,6 @@ | |
# Macos file system | ||
.DS_Store | ||
*/.DS_Store | ||
|
||
# etcd data | ||
default.etcd |
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
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
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
module github.com/peanutzhen/peanutcache | ||
|
||
go 1.16 | ||
|
||
require ( | ||
go.etcd.io/etcd/client/v3 v3.5.0 | ||
google.golang.org/grpc v1.38.0 | ||
google.golang.org/protobuf v1.27.1 | ||
) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
syntax = "proto3"; | ||
|
||
package peanutcachepb; | ||
|
||
option go_package = "github.com/peanutcache/peanutcachepb"; | ||
|
||
message GetRequest { | ||
string group = 1; | ||
string key = 2; | ||
} | ||
|
||
message GetResponse { | ||
bytes value = 1; | ||
} | ||
|
||
service PeanutCache { | ||
rpc Get(GetRequest) returns (GetResponse); | ||
} | ||
|
Oops, something went wrong.