utils

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsNormalized

func ContainsNormalized(s, substr string) bool

ContainsNormalized checks if substr exists within s by: 1. Normalizing both strings 2. Using strings.Contains for comparison Empty strings or normalization failures return false.

func FormatIDs

func FormatIDs(ids []uint64) string

FormatIDs formats a slice of user IDs into a readable string with mentions.

func GenerateSchema

func GenerateSchema[T any]() interface{}

GenerateSchema creates a JSON schema for validating data structures. It uses reflection to analyze the type T and build a schema that: - Disallows additional properties - Includes all fields directly (no references) - Adds descriptions from jsonschema tags.

func NormalizeString

func NormalizeString(s string) string

NormalizeString cleans up text by: 1. Removing diacritical marks (é -> e) 2. Removing all spaces 3. Converting to lowercase. Returns empty string if normalization fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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