Documentation ¶
Index ¶
Constants ¶
View Source
const StatusInfoLog = 101
StatusInfoLog is used to mark a INFO log message from the server.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dispatcher ¶
type Dispatcher interface {
Infof(format string, args ...interface{})
}
type Error ¶
type Error struct {
Msg string `toml:"msg"`
}
Error holds an error message.
type Heartbeater ¶
type Server ¶
func NewServer ¶
func NewServer[Q Heartbeater[R], R any](call func(Dispatcher, Q) R) (*Server[Q, R], error)
NewServer creates a new server which will call the given function with a request Q. The Dispatcher an be used for logging. Any errors needs to be sent in R.
Click to show internal directories.
Click to hide internal directories.