utils

package
v0.0.0-...-6555678 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(src []byte, dest io.Writer, level int)

func CompressByte

func CompressByte(src []byte) []byte

Compression Source: https://github.com/schollz/gofind/blob/master/utils.go#L146-L169

https://github.com/schollz/gofind/blob/master/fingerprint.go#L43-L54

Description:

Compress and Decompress bytes

func Decompress

func Decompress(src io.Reader, dest io.Writer)

func DecompressByte

func DecompressByte(src []byte) []byte

func NewAPIKey

func NewAPIKey(n int) string

NewAPIKey generates and returns an apikey of desired length @param int length of apikey @returns string

func NewUUID

func NewUUID() (string, error)

NewUUID generates and returns url friendly uuid Source: http://play.golang.org/p/4FkNSiUDMg @returns string @returns error

func NewUUID2

func NewUUID2() (string, error)

NewUUID2 generates and returns a uuid @returns string @returns error

func SliceIndex

func SliceIndex(value string, slice []string) int

sliceIndex loops through a []string and returns the index of a string Description:

Loops through array of strings
Checks each string in array for match
If string match occurs returns index

@param value {string} string to find @param slice {[]string} array of strings to search @returns int

func StringInSlice

func StringInSlice(a string, list []string) bool

stringInSlice loops through a []string and returns a bool if string is found @param a {string} string to find @param list {[]string} array of strings to search @returns bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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