utils

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUrlSuffix

func AddUrlSuffix(urlP *url.URL, suffix string)

func DecodeZlib

func DecodeZlib(input []byte) (data []byte, err error)

func GetNewSuffixedUrl

func GetNewSuffixedUrl(urlIn *url.URL, suffix string) (urlOut *url.URL)

func GetTreeAsString

func GetTreeAsString(paths []string) string

func GetUrls

func GetUrls(input string) (urls []*url.URL, err error)

GetUrls parses a URL or domain. In case of domain returns both http(s).

func NumToUnderscores

func NumToUnderscores(n int) string

func ParseUrlOrDomain

func ParseUrlOrDomain(input string) (urlP *url.URL, err error)

func SizeToHumanReadable

func SizeToHumanReadable(size int64) string

func UrlParsedToFolderName

func UrlParsedToFolderName(urlP *url.URL) (dirName string, err error)

func UrlStrToFolderName

func UrlStrToFolderName(urlStr string) (dirName string, err error)

Types

type SafeMapStrings

type SafeMapStrings struct {
	// contains filtered or unexported fields
}

func NewSafeMapStrings

func NewSafeMapStrings() *SafeMapStrings

func (*SafeMapStrings) Add

func (sm *SafeMapStrings) Add(keyAndValue string)

func (*SafeMapStrings) AddKeyValue

func (sm *SafeMapStrings) AddKeyValue(key string, value string)

func (*SafeMapStrings) Count

func (sm *SafeMapStrings) Count() (count int)

func (*SafeMapStrings) Exists

func (sm *SafeMapStrings) Exists(key string) (exists bool)

func (*SafeMapStrings) Get

func (sm *SafeMapStrings) Get(key string) (value string, exists bool)

func (*SafeMapStrings) Lock

func (sm *SafeMapStrings) Lock()

func (*SafeMapStrings) PullRand

func (sm *SafeMapStrings) PullRand() (key string, value string)

func (*SafeMapStrings) Unlock

func (sm *SafeMapStrings) Unlock()

type TreeNode

type TreeNode struct {
	Name     string
	Children map[string]*TreeNode
}

func (*TreeNode) AddPath

func (n *TreeNode) AddPath(path string)

Jump to

Keyboard shortcuts

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