utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.1.2

func Contains(a []string, x string) bool

Contains tells whether a contains x.

func DirExists

func DirExists(path string) bool

DirExists checks if a directory exists

func EnsureDir

func EnsureDir(path string) error

EnsureDir ensures a directory exists

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists

func Find added in v0.1.2

func Find(a []string, x string) int

Find returns the smallest index i at which x == a[i], or len(a) if there is no such index.

func FindID added in v0.1.2

func FindID(a []string, x string) int

func FirstLower added in v0.1.2

func FirstLower(s string) string

FirstLower returns a copy of the string s with its first letter lowercased.

func FirstUpper added in v0.1.2

func FirstUpper(s string) string

FirstUpper returns a copy of the string s with its first letter capitalized.

func GetHost

func GetHost(conf *config.Config, tenant string, ports ...int) string

GetHost constructs the URL based on the given tenant and config, with an optional port.

func GetPlatform

func GetPlatform() string

func GetPlatformExt

func GetPlatformExt() string

GetPlatformExt returns the platform-specific extension

func PathExists

func PathExists(path string) (bool, error)

PathExists checks if a file or directory exists

func RemoveDuplicates added in v0.1.2

func RemoveDuplicates(a []string) []string

RemoveDuplicates removes duplicate elements from a.

func ValidateName

func ValidateName(name string) bool

ValidateName validates a name

func WriteTemplateFile

func WriteTemplateFile(path, content string, data any) error

WriteTemplateFile writes a template file with provided data

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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