utils

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: BSD-3-Clause Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBootstrap

func ConvertBootstrap(peers []string, devMode bool) (peer.BootstrapParams, error)

func ConvertToAddrInfo

func ConvertToAddrInfo(peers []string) ([]libp2p.AddrInfo, error)

func ConvertToMultiAddr

func ConvertToMultiAddr(addr string) (*libp2p.AddrInfo, error)

func CopyDir added in v1.1.5

func CopyDir(srcDir, dstDir string) error

CopyDir copies all files from srcDir to dstDir, skipping existing files in dstDir.

func CopyFile added in v1.1.5

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst. If dst does not exist, it is created. If it exists, its contents are replaced with the contents of src.

func DuplicateModFile added in v1.1.5

func DuplicateModFile(srcFile, dstFile string, ops ...ModFileOps) error

func FormatSwarmKey added in v1.1.5

func FormatSwarmKey(key string) (pnet.PSK, error)

func GenerateSwarmKey added in v1.1.5

func GenerateSwarmKey() (string, error)

func GenerateSwarmKeyFromString added in v1.1.5

func GenerateSwarmKeyFromString(data string) string

Note: This will generate a predictable key Only use if you know whjat you're doing

func SafeAbs added in v1.1.5

func SafeAbs(p string) string

Types

type ModFileOps added in v1.1.5

type ModFileOps func(*modfile.File) error

func ModRename added in v1.1.5

func ModRename(newModuleName string) ModFileOps

func Replace added in v1.1.5

func Replace(oldPath, newPath string) ModFileOps

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL