utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongHTTPCall = errors.New("Wrong http call")

ErrWrongHTTPCall indicates failure due wrong http call

Functions

func GetURLFromConfig

func GetURLFromConfig(name string) (string, error)

GetURLFromConfig retrieves URL from config and checks it

func HidePass

func HidePass(link string) string

HidePass removes pass from URL

func ParamTrue

func ParamTrue(prm string) bool

ParamTrue - returns true if string param indicates true value

func SupportAudioExt

func SupportAudioExt(ext string) bool

SupportAudioExt checks if audio ext is supported

func URLJoin

func URLJoin(urls ...string) string

URLJoin joins urls with '/'

func ValidateResponse

func ValidateResponse(resp *http.Response) error

ValidateResponse returns error if code is not in [200, 299]

Types

type MultiCloseChannel

type MultiCloseChannel struct {
	C chan os.Signal
	// contains filtered or unexported fields
}

MultiCloseChannel can be close several times

func NewMultiCloseChannel

func NewMultiCloseChannel() *MultiCloseChannel

NewMultiCloseChannel creates new channel

func NewSignalChannel

func NewSignalChannel() *MultiCloseChannel

NewSignalChannel returns new channel that listens for system interupts

func (*MultiCloseChannel) Close

func (mc *MultiCloseChannel) Close()

Close closes channel if not closed

Jump to

Keyboard shortcuts

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