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: 0

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