tools

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcurrentAction

func ConcurrentAction(maxConcurrent uint, action func(interface{}) (interface{}, error)) (chan<- interface{}, <-chan ConcurentOutput)

ConcurrentAction create a pool of goroutines for executing action with concurrency limits (default to NumCPU)

func GetID

func GetID(r *http.Request) string

GetID return ID of URL (first section between two slashes)

func IncludesString

func IncludesString(array []string, lookup string) bool

IncludesString checks in an array includes given string

func IsRoot

func IsRoot(r *http.Request) bool

IsRoot checks if current path is root (empty or only trailing slash)

func Sha1

func Sha1(o interface{}) string

Sha1 return SHA1 fingerprint

func ToCamel

func ToCamel(s string) string

ToCamel change first letter to lowerCase

Types

type ConcurentOutput added in v1.7.0

type ConcurentOutput struct {
	Input  interface{}
	Output interface{}
	Err    error
}

ConcurentOutput contains input, output and error from action

Jump to

Keyboard shortcuts

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