util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProjectRoot string

Functions

func ConvertToInt

func ConvertToInt[T int | int64](s string) T

ConvertToInt преобразует строку в целое число

func DecodeFromUTF16 added in v0.0.2

func DecodeFromUTF16(a []uint16) string

DecodeFromUTF16 преобразует срез UTF-16 в строку

func DeepCopy

func DeepCopy[T any](from *T) (*T, error)

DeepCopy копирует любую структуру, про ограничения: "doc/COPY.md"

func Distinct

func Distinct(a []string) []string

Distinct возвращает уникальные элементы из массива строк

func EncodeToUTF16 added in v0.0.2

func EncodeToUTF16(s string) []uint16

EncodeToUTF16 преобразует строку в срез UTF-16

func EscapeMarkdown added in v0.0.2

func EscapeMarkdown(text string) string

EscapeMarkdown экранирует markdown спецсимволы

func GetConfigOptions

func GetConfigOptions() viper.DecoderConfigOption

GetConfigOptions Настраиваем декодирование

func GetCurrDir

func GetCurrDir() string

func GetCurrentDate

func GetCurrentDate() string

GetCurrentDate возвращает текущую дату в формате YYYY-MM-DD

func GetFlag

func GetFlag(name string) *string

func GetReleaseVersion added in v0.0.2

func GetReleaseVersion() string

func HasFlag

func HasFlag(name string) bool

func Int64ToString added in v0.0.2

func Int64ToString(i int64) string

Int64ToString преобразует int64 в строку

func IsPortFree added in v0.0.2

func IsPortFree(addr string) bool

IsPortFree проверяет, свободен ли порт

func MakeDir

func MakeDir(dir string)

func MaskPhoneNumber

func MaskPhoneNumber(phone string) string

maskPhoneNumber маскирует номер телефона, заменяя 5 цифр перед последними двумя Например, +7 926 111 22 33 становится +7926*****33

func NewFuncWithIndex

func NewFuncWithIndex(prefix string) func() string

func RemoveDir

func RemoveDir(dir string)

func SimpleCopy

func SimpleCopy[T any](from *T) *T

func StringToInt64 added in v0.0.2

func StringToInt64(s string) int64

StringToInt64 преобразует строку в int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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