utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: GPL-3.0, LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsPtr

func AsPtr[T any](value T) *T

func FileExists

func FileExists(filepath string) bool

func FileReaderRead

func FileReaderRead(fileName string) (string, error)

func GetLineByPosition

func GetLineByPosition(filePath string, position int) int

func GetPathWithOnlyFilename

func GetPathWithOnlyFilename(path string) (string, error)

func GetPathWithoutFilename

func GetPathWithoutFilename(path string) (string, error)

func GlogToRegex

func GlogToRegex(glog string) string

func InArray

func InArray(needle string, haystack []string) bool

func IsPrimitiveType

func IsPrimitiveType(v string) bool

func IsReadable

func IsReadable(filepath string) bool

func IsStruct

func IsStruct(object *ast.Object) bool

func IsWriteable

func IsWriteable(path string) bool

func Map

func Map[T1 comparable, T2, V any](ts map[T1]T2, fn func(T1, T2) V) []V

func MapKeyExists

func MapKeyExists[Key comparable, Value any](v map[Key]Value, k Key) bool

func MapKeyIsArrayOfStrings

func MapKeyIsArrayOfStrings[Key comparable](v map[Key]interface{}, k Key) bool

func MapKeyIsInt

func MapKeyIsInt[Key comparable](v map[Key]interface{}, k Key) bool

func MapKeyIsString

func MapKeyIsString[Key comparable](v map[Key]interface{}, k Key) bool

func MapSlice

func MapSlice[T, V any](ts []T, fn func(T) V) []V

func ParseYamlFile

func ParseYamlFile(file string) (map[string]interface{}, error)

func PathCanonicalize

func PathCanonicalize(path string) string

func PathNormalize

func PathNormalize(path string) string

func Sha1File

func Sha1File(path string) (string, error)

func SplObjectID

func SplObjectID(v interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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