Documentation ¶
Index ¶
- func CalculatePieceSize(fileSize int64) (int64, float64)
- func CalculateRealCost(sectorSizeBytes float64, pricePerGiB decimal.Decimal) decimal.Decimal
- func CopyFile(srcFilePath, destFilePath string) (int64, error)
- func CreateDir(dir string) error
- func CreateFileWithContents(filepath string, lines []string) (int, error)
- func DecodeJwtToken(tokenStr string) (jwt.MapClaims, error)
- func GenerateFile(filepath, filename string, filesize int64)
- func GetByteSizeFromStr(sizeStr string) *float64
- func GetCurrentEpoch() int
- func GetDayNumFromEpoch(epoch int) int
- func GetDecimalFromStr(source string) (*decimal.Decimal, error)
- func GetEpochFromDay(day int) int
- func GetEpochInMillis() (millis int64)
- func GetFieldFromJson(jsonStr string, fieldName string) interface{}
- func GetFieldMapFromJson(jsonStr string, fieldName string) map[string]interface{}
- func GetFieldStrFromJson(jsonStr string, fieldName string) string
- func GetFileSize(fileFullPath string) int64
- func GetFileSize2(dir, fileName string) int64
- func GetFloat64FromStr(numStr *string) (float64, error)
- func GetInt64FromStr(numStr string) int64
- func GetIntFromStr(numStr string) (int, error)
- func GetMinFloat64(val1, val2 *float64) *float64
- func GetNumStrFromStr(numStr string) string
- func GetPathType(dirFullPath string) int
- func GetRandInRange(min, max int) int
- func IsDirExists(dir string) bool
- func IsFileExists(filePath, fileName string) bool
- func IsFileExistsFullPath(fileFullPath string) bool
- func IsPathFile(dirFullPath string) (*bool, error)
- func IsSameDay(nanoSec1, nanoSec2 int64) bool
- func IsStrEmpty(str *string) bool
- func RandString(optionChars string, strLen int) string
- func RandStringRunes(letterRunes []rune, strLen int) string
- func ReadAllLines(dir, filename string) ([]string, error)
- func ReadFile(filePath string) (string, []byte, error)
- func RemoveFile(filePath, fileName string)
- func ToJson(obj interface{}) string
- func UrlJoin(root string, parts ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePieceSize ¶ added in v0.2.22
https://docs.filecoin.io/store/lotus/very-large-files/#maximizing-storage-per-sector
func CalculateRealCost ¶ added in v0.2.22
func CreateFileWithContents ¶
func DecodeJwtToken ¶ added in v0.0.9
func GenerateFile ¶ added in v0.0.9
func GetByteSizeFromStr ¶
func GetCurrentEpoch ¶
func GetCurrentEpoch() int
func GetDayNumFromEpoch ¶
func GetEpochFromDay ¶
func GetEpochInMillis ¶
func GetEpochInMillis() (millis int64)
GetEpochInMillis get current timestamp
func GetFieldFromJson ¶
func GetFieldMapFromJson ¶
func GetFieldStrFromJson ¶
func GetFileSize ¶
func GetFileSize2 ¶
func GetFloat64FromStr ¶
func GetInt64FromStr ¶
func GetIntFromStr ¶
func GetMinFloat64 ¶
func GetNumStrFromStr ¶
func GetPathType ¶
func GetRandInRange ¶
func IsDirExists ¶ added in v0.0.9
func IsFileExists ¶
func IsFileExistsFullPath ¶ added in v0.2.16
func IsPathFile ¶
func IsStrEmpty ¶
func RandString ¶ added in v0.2.20
func RandStringRunes ¶ added in v0.0.9
func ReadAllLines ¶
func RemoveFile ¶
func RemoveFile(filePath, fileName string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.