Make version print nicely

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera
2019-10-09 22:18:53 +02:00
parent 8dc088b4dd
commit 2a9ab727c8
3 changed files with 14 additions and 1 deletions
+7
View File
@@ -2,6 +2,7 @@ package api
import (
"context"
"fmt"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-filestore"
@@ -9,6 +10,7 @@ import (
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/filecoin-project/go-lotus/build"
"github.com/filecoin-project/go-lotus/chain/address"
"github.com/filecoin-project/go-lotus/chain/store"
"github.com/filecoin-project/go-lotus/chain/types"
@@ -173,6 +175,11 @@ type Version struct {
// TODO: git commit / os / genesis cid?
}
func (v Version) String() string {
vM, vm, vp := build.VersionInts(v.APIVersion)
return fmt.Sprintf("%s+api%d.%d.%d", v.Version, vM, vm, vp)
}
type Import struct {
Status filestore.Status
Key cid.Cid