open-vault/sdk/helper/parseutil/parseutil.go

45 lines
1.1 KiB
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// DEPRECATED: this has been moved to go-secure-stdlib and will be removed
package parseutil
import (
"time"
extparseutil "github.com/hashicorp/go-secure-stdlib/parseutil"
2018-04-17 22:52:09 +00:00
sockaddr "github.com/hashicorp/go-sockaddr"
)
2021-02-22 18:44:55 +00:00
func ParseCapacityString(in interface{}) (uint64, error) {
return extparseutil.ParseCapacityString(in)
2021-02-22 18:44:55 +00:00
}
func ParseDurationSecond(in interface{}) (time.Duration, error) {
return extparseutil.ParseDurationSecond(in)
}
func ParseAbsoluteTime(in interface{}) (time.Time, error) {
return extparseutil.ParseAbsoluteTime(in)
}
func ParseInt(in interface{}) (int64, error) {
return extparseutil.ParseInt(in)
}
func ParseBool(in interface{}) (bool, error) {
return extparseutil.ParseBool(in)
}
2018-02-16 22:19:34 +00:00
func ParseString(in interface{}) (string, error) {
return extparseutil.ParseString(in)
}
2018-02-16 22:19:34 +00:00
func ParseCommaStringSlice(in interface{}) ([]string, error) {
return extparseutil.ParseCommaStringSlice(in)
2018-02-16 22:19:34 +00:00
}
2018-04-17 22:52:09 +00:00
func ParseAddrs(addrs interface{}) ([]*sockaddr.SockAddrMarshaler, error) {
return extparseutil.ParseAddrs(addrs)
2018-04-17 22:52:09 +00:00
}