util

package
Version: v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: BSD-2-Clause-Views Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrToPath

func AddrToPath(s string) string

some.host:2003 -> some_host_2003 http://some.host:8080 -> http_some_host_8080

func Key added in v0.11.0

func Key(routeName, addr string) string

some.host:2003, kafkaRoute -> kafkaRoute_some_host_2003 http://some.host:8080, kafkaRoute -> kafkaRoute_http_some_host_8080

Types

type Limiter added in v0.12.0

type Limiter chan struct{}

Limiter limits concurrency Users need to call Add() before starting work and Done() when the work is done. Add() will block if the Limiters limit has already been reached and unblock when another thread calls Done()

func NewLimiter added in v0.12.0

func NewLimiter(limit int) Limiter

NewLimiter creates a limiter with l slots

func (Limiter) Add added in v0.12.0

func (l Limiter) Add()

func (Limiter) Done added in v0.12.0

func (l Limiter) Done()

Source Files

Jump to

Keyboard shortcuts

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