util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashKey

func HashKey(key string) int

HashKey hash a string to an int value using fnv32 algorithm

func PattenMatch

func PattenMatch(pattern, src string) bool

PattenMatch matches a string with a wildcard pattern. It supports following cases: - h?llo matches hello, hallo and hxllo - h*llo matches hllo and heeeello - h[ae]llo matches hello and hallo, but not hillo - h[^e]llo matches hallo, hbllo, ... but not hello - h[a-b]llo matches hallo and hbllo - Use \ to escape special characters if you want to match them verbatim.

Types

type Pump

type Pump struct {
	Out chan any
	In  map[int]<-chan any
	// contains filtered or unexported fields
}

func NewPump

func NewPump() *Pump

func (*Pump) AddIn

func (p *Pump) AddIn(in <-chan any)

func (*Pump) RunForward

func (p *Pump) RunForward()

RunForward blocks and forwards all inbound channels to a single outbound channel for exactly 1 message.

Jump to

Keyboard shortcuts

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