diff --git a/README.md b/README.md index 287e382..d236b87 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # srpc -Easy to use RPC Framework writting in golang \ No newline at end of file +Easy to use RPC Framework written in golang diff --git a/client.go b/client.go new file mode 100644 index 0000000..4fad9f6 --- /dev/null +++ b/client.go @@ -0,0 +1,7 @@ +package srpc + +var REQUEST_HEADER_SIZE = int32(8) + +type requestHeader struct { + size int64 +} diff --git a/server.go b/server.go new file mode 100644 index 0000000..54e59af --- /dev/null +++ b/server.go @@ -0,0 +1,33 @@ +package srpc + +import ( + "sync" +) + +const ( + AIN uint8 = 0 + AOUT uint8 = 1 + AINOUT uint8 = 2 +) + +const ( + OK uint8 = 0 + ERR uint8 = 1 +) + +var RESPONSE_HEADER_SIZE = int32(9) + +type responseHeader struct { + size int64 + status uint8 +} + +type Server struct { + serviceMap sync.Map +} + +func NewServer() *Server { + return &Server{} +} + +var DefaultServer = NewServer()