Documentation
¶
Overview ¶
Package utils provides utility functions and types used across the Omnom application.
This package contains helper functions for common operations including:
- String-based error types for constant errors
- Key-value data structure construction from variadic arguments
- File extension extraction from URLs and paths
These utilities are used throughout the codebase to reduce code duplication and provide consistent behavior for common operations.
Example usage:
// Create a string error
const ErrNotFound = utils.StringError("not found")
// Build a map from key-value pairs
data, err := utils.KVData("name", "John", "age", 30)
// Extract file extension
ext := utils.GetExtension("https://example.com/image.jpg")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExtension ¶ added in v0.8.0
GetExtension extracts the file extension from a URL or path.
Types ¶
type StringError ¶
type StringError string
StringError is a string that implements the error interface.
func (StringError) Error ¶
func (e StringError) Error() string
Click to show internal directories.
Click to hide internal directories.