34 lines
362 B
Go
34 lines
362 B
Go
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()
|