This commit is contained in:
naiba
2020-12-09 10:27:00 +08:00
parent 620d2ca68f
commit 8e30f48395
6 changed files with 13 additions and 9 deletions

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)
}