func (n Node) String() string {
	return fmt.Sprintf(
		"%s %s %d %d %d", n.Name, n.Host, n.RPCPort, n.ClientPort, n.ReseedPort)
}
String implements the fmt.Stringer interface, returning a space separated
string representation of a Node.
package config
import (
	"errors"
	"fmt"
	"strconv"
	"strings"
)
type Node struct {
	Name       string `json:"name"`
	Host       string `json:"host"`
	RPCPort    uint64 `json:"rpcPort"`
	ClientPort uint64 `json:"clientPort"`
	ReseedPort uint64 `json:"httpPort"`
	Type       string `json:"type"`
	SlaveID    string `json:"slaveID"`
}
var ErrUnmarshal = errors.New("config: unmarshaling failed")
func Parse(text string) (*Node, error) {
	fs := strings.Fields(string(text))
	if len(fs) != 5 {
		return nil, ErrUnmarshal
	}
	n := &Node{Name: fs[0], Host: fs[1]}
	var err error
	if n.RPCPort, err = strconv.ParseUint(fs[2], 10, 64); err != nil {
		return nil, ErrUnmarshal
	} else if n.ClientPort, err = strconv.ParseUint(fs[3], 10, 64); err != nil {
		return nil, ErrUnmarshal
	} else if n.ReseedPort, err = strconv.ParseUint(fs[4], 10, 64); err != nil {
		return nil, ErrUnmarshal
	}
	return n, nil
}