OSDN Git Service

feat: add node discovery and status check (#374)
[bytom/vapor.git] / toolbar / federation / types / types.go
diff --git a/toolbar/federation/types/types.go b/toolbar/federation/types/types.go
deleted file mode 100644 (file)
index e3f8f48..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package types
-
-import (
-       "fmt"
-       "strconv"
-       "time"
-)
-
-type Timestamp time.Time
-
-func (t *Timestamp) Unix() int64 {
-       return time.Time(*t).Unix()
-}
-
-func (t *Timestamp) MarshalJSON() ([]byte, error) {
-       ts := time.Time(*t).Unix()
-       stamp := fmt.Sprint(ts)
-       return []byte(stamp), nil
-}
-
-func (t *Timestamp) UnmarshalJSON(b []byte) error {
-       ts, err := strconv.Atoi(string(b))
-       if err != nil {
-               return err
-       }
-
-       *t = Timestamp(time.Unix(int64(ts), 0))
-       return nil
-}