update version; minor refactoring
This commit is contained in:
@@ -57,8 +57,8 @@ func (r DataType) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
// GenerateResyncTypeFromString
|
||||
func GenerateResyncTypeFromString(str string) (DataType, error) {
|
||||
// GenerateDataTypeFromString
|
||||
func GenerateDataTypeFromString(str string) (DataType, error) {
|
||||
switch strings.ToLower(str) {
|
||||
case "full", "f":
|
||||
return Full, nil
|
||||
@@ -79,7 +79,7 @@ func GenerateResyncTypeFromString(str string) (DataType, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func SupportedResyncType(d DataType, c ChainType) (bool, error) {
|
||||
func SupportedDataType(d DataType, c ChainType) (bool, error) {
|
||||
switch c {
|
||||
case Ethereum:
|
||||
switch d {
|
||||
|
||||
@@ -90,7 +90,7 @@ func GetIPFSMode() (IPFSMode, error) {
|
||||
if ipfsMode == "" {
|
||||
return DirectPostgres, nil
|
||||
}
|
||||
return NewIPLFMode(ipfsMode)
|
||||
return NewIPFSMode(ipfsMode)
|
||||
}
|
||||
|
||||
// GetBtcNodeAndClient returns btc node info from path url
|
||||
|
||||
@@ -44,15 +44,15 @@ func (c IPFSMode) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
func NewIPLFMode(name string) (IPFSMode, error) {
|
||||
func NewIPFSMode(name string) (IPFSMode, error) {
|
||||
switch strings.ToLower(name) {
|
||||
case "local", "interface", "minimal":
|
||||
return LocalInterface, nil
|
||||
case "remote", "client":
|
||||
return RemoteClient, nil
|
||||
return RemoteClient, errors.New("remote IPFS client mode is not currently supported")
|
||||
case "postgres", "direct":
|
||||
return DirectPostgres, nil
|
||||
default:
|
||||
return Unknown, errors.New("invalid name for ipfs mode")
|
||||
return Unknown, errors.New("unrecognized name for ipfs mode")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user