util

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoListener

func AutoListener(protocol, address string, startPort, endPort uint16) (net.Listener, error)

func AutoListenerAddress

func AutoListenerAddress(protocol, address string, startPort, endPort uint16) (string, error)

func BytesToSize

func BytesToSize(sz int64) string

func DumpHeaders

func DumpHeaders(headers http.Header, in bool) string

func EnableSuperNetwork

func EnableSuperNetwork(zCfg *ziti.Config)

func FormatHostDetailsWithUser

func FormatHostDetailsWithUser(username, hostname, hostDetail, description string) (formattedHostDetail, formattedDescription string)

FormatHostDetailsWithUser combines the username and host details into a single string. It also returns a formatted description string if the input description is the default "<user>@<hostname>".

func GetHostDetails

func GetHostDetails() (hostname string, hostDetail string, username string, err error)

GetHostDetails returns the hostname, detailed host information, and username. The detailed host information includes OS, platform, kernel details, and username.

func IsValidEmail

func IsValidEmail(e string) bool

func IsValidNameInNamespace

func IsValidNameInNamespace(uniqueName string, skipProfanityCheck bool) bool

IsValidNameInNamespace ensures that the string represents a valid name in a namespace. Lowercase alphanumeric only. 3-64 characters.

func IsValidShareToken

func IsValidShareToken(uniqueName string, skipProfanityCheck bool) bool

IsValidShareToken ensures that the string represents a valid unique name. Lowercase alphanumeric only. 3-32 characters.

func NameInNamespace

func NameInNamespace(name, namespace string) string

func NewRequestsWrapper

func NewRequestsWrapper(proxy *httputil.ReverseProxy) *requestsWrapper

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration extends time.ParseDuration to support 'd' (days) as a unit. it converts days to hours (1d = 24h) before parsing. examples: "24h", "7d", "2d6h30m", "1d12h"

Types

This section is empty.

Jump to

Keyboard shortcuts

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