helper

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToMap added in v0.15.6

func ArrayToMap[T any](m map[string]T, e []T, f func(T) string) map[string]T

ArrayToMap converts an array to a map using a key function

func Contains added in v0.15.6

func Contains(a string, b string) bool

Contains checks if a string contains a substring case insensitive

func CopyDir added in v0.15.6

func CopyDir(src, dst string) error

func CopyFile

func CopyFile(source, target string) error

func Dir added in v0.12.1

func Dir(path string) string

func Ext added in v0.15.1

func Ext(file string) string

func FindDocuments

func FindDocuments(path string) ([]string, error)

func GetFreePort added in v0.8.0

func GetFreePort() (int, error)

func HasExt added in v0.15.1

func HasExt(file string, ext string) bool

func IsDir

func IsDir(elem string) bool

func IsDocument

func IsDocument(path string) bool

func IsExist

func IsExist(path string) bool

func IsFile

func IsFile(path string) bool

func Join added in v0.9.0

func Join(elem ...string) string

func ListDir added in v0.16.0

func ListDir(path string)

func MakeDir added in v0.12.1

func MakeDir(dst string) error

func MakeIdGenerator added in v0.8.0

func MakeIdGenerator(prefix string) func() string

func MakeIntIdGenerator added in v0.19.0

func MakeIntIdGenerator() func() uint64

func MapToArray added in v0.15.6

func MapToArray[T any](m map[string]T) []T

MapToArray converts a map to an array

func Must added in v0.12.0

func Must(err error)

func ParseJson

func ParseJson(data []byte, out any) error

func ParseYaml

func ParseYaml(data []byte, out any) error

func ReadDocument

func ReadDocument(path string, v any) error

func ReadYamlFromData

func ReadYamlFromData(in []byte, out any) error

func RemoveDir added in v0.12.0

func RemoveDir(dst string) error

func WriteDocument

func WriteDocument(path string, v any) error

func WriteFile added in v0.12.1

func WriteFile(dst string, data []byte) error

func YamlToJson

func YamlToJson(in []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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