From d800b6f92531741857310884bfb89f34cdfb76af Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Fri, 11 Mar 2022 20:55:24 -0800 Subject: [PATCH] Documentation: literals -> pointers --- .gitignore | 2 ++ README.md | 45 +++++++-------------------------------------- entropy/README.md | 18 ------------------ hash/README.md | 22 ---------------------- linux/README.md | 30 ------------------------------ squish/README.md | 43 ------------------------------------------- 6 files changed, 9 insertions(+), 151 deletions(-) delete mode 100644 entropy/README.md delete mode 100644 hash/README.md delete mode 100644 linux/README.md delete mode 100644 squish/README.md diff --git a/.gitignore b/.gitignore index 485dee6..a54a77a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea +*.swp +*.save diff --git a/README.md b/README.md index a5597d0..aaede60 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,22 @@ # common +[![GoDoc](https://godoc.org/git.tcp.direct/kayos/common?status.svg)](https://pkg.go.dev/git.tcp.direct/kayos/common) [![codecov](https://codecov.io/gh/yunginnanet/common/branch/master/graph/badge.svg?token=vk5frSGqhq)](https://codecov.io/gh/yunginnanet/common) + Welcome to things. Here are some of the aforementioned: -* [hash](./hash) +* [hash](https://pkg.go.dev/git.tcp.direct/kayos/common/hash) -* [linux](./linux) +* [linux](https://pkg.go.dev/git.tcp.direct/kayos/common/linux) -* [squish](./squish) +* [squish](https://pkg.go.dev/git.tcp.direct/kayos/common/squish) -* [entropy](./entropy) +* [entropy](https://pkg.go.dev/git.tcp.direct/kayos/common/entropy) ## base `import "git.tcp.direct/kayos/common"` -### Usage +## Base #### func Abs @@ -29,36 +31,3 @@ Abs will give you the positive version of a negative integer, quickly. func Fprint(w io.Writer, s string) ``` Fprint is fmt.Fprint with error handling. - -#### func OneInA - -```go -func OneInA(million int) bool -``` - -#### func RNG - -```go -func RNG(n int) int -``` -RNG is a Random Number Generator - -#### func RandSleepMS - -```go -func RandSleepMS(n int) -``` -RandSleepMS sleeps for a random period of time with a maximum of n milliseconds. - -#### func RandStr - -```go -func RandStr(size int) string -``` -RandStr generates a random alphanumeric string with a max length of size. - -#### func RangeIterate - -```go -func RangeIterate(ips interface{}) chan *ipa.IP -``` diff --git a/entropy/README.md b/entropy/README.md deleted file mode 100644 index 7f65f3e..0000000 --- a/entropy/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# entropy - - `import "git.tcp.direct/kayos/common/entropy"` - - -## Usage - -#### func RNG - -```go -func RNG(n int) int -``` - -#### func RandomStrChoice - -```go -func RandomStrChoice(choice []string) string -``` diff --git a/hash/README.md b/hash/README.md deleted file mode 100644 index c1dbeed..0000000 --- a/hash/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# hash - - `import "git.tcp.direct/kayos/common/hash"` - - -## Usage - -#### func Blake2bSum - -```go -func Blake2bSum(b []byte) []byte -``` -Blake2bSum ignores all errors and gives you a blakae2b 64 hash value as a byte -slice. (or panics somehow) - -#### func BlakeEqual - -```go -func BlakeEqual(a []byte, b []byte) bool -``` -BlakeEqual will take in two byte slices, hash them with blake2b, and tell you if -the resulting checksums match. diff --git a/linux/README.md b/linux/README.md deleted file mode 100644 index 5bd6c99..0000000 --- a/linux/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## linux - - import "git.tcp.direct/kayos/common/linux" - -### Usage - -```go -const ( - // UnameOS is "sysname" or "uname -s". - UnameOS - // UnameArch is "machine" or "uname -m". - UnameArch - // UnameRelease is "release" or "uname -r". - UnameRelease - // UnameDomain is "domainname", the kernel domain name. - UnameDomain - // UnameVersion is "version", or "uname -v". - UnameVersion - // UnameHostname is "Nodename" or "uname -n" - UnameHostname -) -``` - -#### func GetUname - -```go -func GetUname(unameFlags string) (un string, err error) -``` -GetUname uses system calls to retrieve the same values as the uname linux -command diff --git a/squish/README.md b/squish/README.md deleted file mode 100644 index 74de34d..0000000 --- a/squish/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# squish - - `import "git.tcp.direct/kayos/common/squish"` - -## Usage - -#### func B64d - -```go -func B64d(str string) (data []byte) -``` -B64d decodes the given string into the original slice of bytes. Do note that -this is for non critical tasks, it has no error handling for purposes of clean -code. - -#### func B64e - -```go -func B64e(cytes []byte) (data string) -``` -B64e encodes the given slice of bytes into base64 standard encoding. - -#### func Gunzip - -```go -func Gunzip(data []byte) ([]byte, error) -``` -Gunzip decompresses a gzip compressed slice of bytes. - -#### func Gzip - -```go -func Gzip(data []byte) ([]byte, error) -``` -Gzip compresses as slice of bytes using gzip compression. - -#### func UnpackStr - -```go -func UnpackStr(encoded string) string -``` -UnpackStr UNsafely unpacks (usually banners) that have been base64'd and then -gzip'd.