|
@@ -41,6 +41,18 @@ type Server struct {
|
|
|
contextMap map[int32]*Context
|
|
|
}
|
|
|
|
|
|
+func WithUsage(usage string) Option {
|
|
|
+ return func(o *Options) {
|
|
|
+ o.Usage = usage
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func WithDescription(desc string) Option {
|
|
|
+ return func(o *Options) {
|
|
|
+ o.Description = desc
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func (svr *Server) writePack(conn net.Conn, packet *Frame) (err error) {
|
|
|
if packet.Timestamp == 0 {
|
|
|
packet.Timestamp = time.Now().Unix()
|