38 lines
462 B
Go
38 lines
462 B
Go
package srpc
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type argumentType uint8
|
|
|
|
const (
|
|
AIN argumentType = 0
|
|
AOUT argumentType = 1
|
|
AINOUT argumentType = 2
|
|
)
|
|
|
|
type responseStatus uint8
|
|
|
|
const (
|
|
OK responseStatus = 0
|
|
ERR responseStatus = 1
|
|
)
|
|
|
|
var RESPONSE_HEADER_SIZE = int32(9)
|
|
|
|
type responseHeader struct {
|
|
size int64
|
|
status responseStatus
|
|
}
|
|
|
|
type Server struct {
|
|
serviceMap sync.Map
|
|
}
|
|
|
|
func NewServer() *Server {
|
|
return &Server{}
|
|
}
|
|
|
|
var DefaultServer = NewServer()
|