utils

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package utils contains utility functions for the SonicRed server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutLog

func CutLog(s string) string

CutLog truncates a string to ensure it does not exceed a specified length, appending a suffix if truncation occurs.

func ExecutableTime

func ExecutableTime() string

ExecutableTime retrieves the modification time of the current executable and returns it formatted as an RFC3339 string. If the executable lookup fails, the time since the start of the program is returned instead.

Types

type LangPref

type LangPref struct {
	Lang    string
	Variant string
	Pref    float32
}

LangPref represents a language preference with language, variant, and a quality factor (preference value).

func ParseLanguageHeader

func ParseLanguageHeader(langHeader string) []LangPref

ParseLanguageHeader parses the Accept-Language header and returns a sorted slice of LangPref by preference value.

Jump to

Keyboard shortcuts

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