This commit is contained in:
naiba committed 2020-12-09 10:27:00 +08:00
1 parent 7e0e947692
commit 5bb5e32758
6 files changed
+13 -9

No files matched your search

+5
View File
@@ -1,6 +1,7 @@
package model
import (
"fmt"
"time"
pb "github.com/naiba/nezha/proto"
@@ -19,3 +20,7 @@ type Server struct {
Stream pb.NezhaService_HeartbeatServer `gorm:"-" json:"-"`
StreamClose chan<- error `gorm:"-" json:"-"`
}
func (s Server) Marshal() string {
return fmt.Sprintf(`{"ID":%d,"Name":"%s","Secret":"%s"}`, s.ID, s.Name, s.Secret)
}