Started with implementation

This commit is contained in:
Matthias Fulz 2019-10-22 01:32:56 +02:00
parent b9c26b9441
commit a6c43af8bb
3 changed files with 41 additions and 1 deletions

View File

@ -1,3 +1,3 @@
# srpc
Easy to use RPC Framework writting in golang
Easy to use RPC Framework written in golang

7
client.go Normal file
View File

@ -0,0 +1,7 @@
package srpc
var REQUEST_HEADER_SIZE = int32(8)
type requestHeader struct {
size int64
}

33
server.go Normal file
View File

@ -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()