Documentation
¶
Overview ¶
Package util implements various utility functions used within ipfs that do not currently have a better place to live.
Index ¶
- Constants
- Variables
- func ErrCast() errordeprecated
- func ExpandPathnames(paths []string) ([]string, error)deprecated
- func FileExists(filename string) booldeprecated
- func FormatRFC3339(t time.Time) stringdeprecated
- func GetenvBool(name string) booldeprecated
- func Hash(data []byte) mh.Multihashdeprecated
- func IsValidHash(s string) booldeprecated
- func NewSeededRand(seed int64) io.Readerdeprecated
- func NewTimeSeededRand() io.Readerdeprecated
- func ParseRFC3339(s string) (time.Time, error)deprecated
- func Partition(subject string, sep string) (string, string, string)deprecated
- func RPartition(subject string, sep string) (string, string, string)deprecated
- func XOR(a, b []byte) []bytedeprecated
- type MultiErrdeprecated
Constants ¶
const DefaultIpfsHash = mh.SHA2_256
DefaultIpfsHash is the current default hash function used by IPFS.
Deprecated: use github.com/ipfs/boxo/util.DefaultIpfsHash
Variables ¶
var Debug bool
Debug is a global flag for debugging.
Deprecated: use github.com/ipfs/boxo/util.Debug
var ErrNotImplemented = errors.New("error: not implemented yet")
ErrNotImplemented signifies a function has not been implemented yet.
Deprecated: use github.com/ipfs/boxo/util.ErrNotImplemented
var ErrSearchIncomplete = errors.New("error: search incomplete")
ErrSearchIncomplete implies that a search type operation didn't find the expected node, but did find 'a' node.
Deprecated: use github.com/ipfs/boxo/util.ErrSearchIncomplete
var ErrTimeout = errors.New("error: call timed out")
ErrTimeout implies that a timeout has been triggered
Deprecated: use github.com/ipfs/boxo/util.ErrTimeout
var TimeFormatIpfs = time.RFC3339Nano
TimeFormatIpfs is the format ipfs uses to represent time in string form.
Deprecated: use github.com/ipfs/boxo/util.TimeFormatIpfs
Functions ¶
func ExpandPathnames
deprecated
func FileExists
deprecated
func FormatRFC3339
deprecated
func GetenvBool
deprecated
func IsValidHash
deprecated
func NewSeededRand
deprecated
func NewTimeSeededRand
deprecated
func ParseRFC3339
deprecated
func Partition
deprecated
Partition splits a subject 3 parts: prefix, separator, suffix. The first occurrence of the separator will be matched. ie. Partition("Ready, steady, go!", ", ") -> ["Ready", ", ", "steady, go!"]
Deprecated: use github.com/ipfs/boxo/util.Partition
func RPartition
deprecated
RPartition splits a subject 3 parts: prefix, separator, suffix. The last occurrence of the separator will be matched. ie. RPartition("Ready, steady, go!", ", ") -> ["Ready, steady", ", ", "go!"]
Deprecated: use github.com/ipfs/boxo/util.RPartition