utils

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: BSD-3-Clause-Clear Imports: 9 Imported by: 0

Documentation

Overview

pkg/utils/identifier.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient added in v0.12.2

func NewHttpClient(tlsNoVerify bool) *http.Client

func NormalizeEndpoint

func NormalizeEndpoint(endpoint string) (*url.URL, error)

func ReadBytesFromFile added in v0.18.0

func ReadBytesFromFile(filePath string, maxBytes int64) ([]byte, error)

Types

type IdentifierStringType added in v0.21.0

type IdentifierStringType int

IdentifierStringType defines the type of string identified.

const (
	// StringTypeUnknown indicates the string type could not be determined or is empty.
	StringTypeUnknown IdentifierStringType = iota
	// StringTypeUUID indicates the string is a valid UUID.
	StringTypeUUID
	// StringTypeURI indicates the string is a valid absolute URI.
	StringTypeURI
	// StringTypeGeneric indicates the string is not a UUID or URI, and can be treated as a generic identifier (e.g., a name).
	StringTypeGeneric
)

func ClassifyString added in v0.21.0

func ClassifyString(input string) IdentifierStringType

ClassifyString attempts to determine if the input string is a UUID, an absolute URI, or a generic string. It prioritizes UUID, then URI, then defaults to Generic.

func (IdentifierStringType) String added in v0.21.0

func (it IdentifierStringType) String() string

String returns a string representation of the IdentifierStringType.

Jump to

Keyboard shortcuts

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