utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Contain

func Contain(src []string, target, alias string) bool

func ContextWithOsSignal

func ContextWithOsSignal(sig ...os.Signal) context.Context

ContextWithOsSignal returns a context with by default is listening to SIGHUP, SIGINT, SIGTERM, SIGQUIT os signals to cancel

func GetAvailablePort added in v0.5.0

func GetAvailablePort() int

func GetListHash added in v0.4.0

func GetListHash(list []string) string

GetListHash generate a hash from list of strings

func GetRandomPort added in v0.5.0

func GetRandomPort() int

func IsPortAvailable added in v0.5.0

func IsPortAvailable(port int) bool

func OneOf added in v0.4.8

func OneOf(s string, list ...string) bool

OneOf returns true if s is one of list

Types

This section is empty.

Jump to

Keyboard shortcuts

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