Documentation ¶
Index ¶
- Constants
- func DigestAvaMsg(msg string) []byte
- func DoesNotInclude(strs []string, val string) bool
- func Dump(obj interface{}) string
- func EnsureFullPath(path string, mod os.FileMode)
- func EnsurePath(path string, mod os.FileMode)
- func Fatalf(format string, args ...interface{})
- func FindMatch(pattern string, data string) [][]string
- func Includes(strs []string, val string) bool
- func MustGetUser() string
- func PublicKeyFromAvaMsg(msg string, avasigcb58 string) (avacrypto.PublicKey, error)
- func ReadFileBytes(filePath string) ([]byte, error)
- func SigToRS(sig mpsecdsa.Signature) (big.Int, big.Int)
- type StringSet
- func (set StringSet) Clone() StringSet
- func (set StringSet) Delete(s string)
- func (set StringSet) Exclude(other StringSet)
- func (set StringSet) Has(s string) bool
- func (set StringSet) Join(other StringSet)
- func (set StringSet) ReverseSorted() []string
- func (set StringSet) Set(s string)
- func (set StringSet) Sorted() []string
Constants ¶
const ( SimpleDateFormat = "Jan 2" SimpleTimeFormat = "15:04 MST" MinimumTimeFormat12 = "3:04 PM" MinimumTimeFormat24 = "15:04" TimestampFormat = "2006-01-02T15:04:05-0700" )
Variables ¶
This section is empty.
Functions ¶
func DigestAvaMsg ¶
Same algo as Avax wallet msg is the message, returns the hash of the full msg with prefix
func DoesNotInclude ¶
DoesNotInclude takes a slice of strings and a target string and returns TRUE if the slice does not include the target, FALSE if it does
Example:
x := DoesNotInclude([]string{"cat", "dog", "rat"}, "dog") > false x := DoesNotInclude([]string{"cat", "dog", "rat"}, "pig") > true
func EnsureFullPath ¶
EnsureFullPath ensures a directory exist from the given path.
func EnsurePath ¶
EnsurePath ensures a directory exist from the given path.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf formats a message to standard error and exits the program. The message is also printed to standard output if standard error is redirected to a different file.
func FindMatch ¶
FindMatch takes a regex pattern and a string of data and returns back all the matches in that string
func Includes ¶
Includes takes a slice of strings and a target string and returns TRUE if the slice includes the target, FALSE if it does not
Example:
x := Includes([]string{"cat", "dog", "rat"}, "dog") > true x := Includes([]string{"cat", "dog", "rat"}, "pig") > false
func PublicKeyFromAvaMsg ¶
Validate a msg signed with the Avalanche web wallet "Sign Message" feature
func ReadFileBytes ¶
ReadFileBytes reads the contents of a file and returns those contents as a slice of bytes
Types ¶
type StringSet ¶
type StringSet map[string]struct{}
https://github.com/ungerik/go-dry/blob/master/string.go StringSet wraps map[string]struct{} with some useful methods. TODO use this for wallets / users etc