helper

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultImageTag string = "latest"
	ImageSeparator  string = ":"
)

Variables

This section is empty.

Functions

func AddFileExtension

func AddFileExtension(filename, outputType string) string

func CleanJSON added in v1.12.3

func CleanJSON(jsonString string) (string, error)

CleanJSON removes trailing carriage return, newline, and backslash from a JSON string.

func CleanValue added in v1.12.3

func CleanValue(v interface{}) interface{}

CleanValue removes trailing carriage return, newline, and backslash from a JSON value.

func FormatImage

func FormatImage(image string) string

FormatImage set default image tag if not provided

func GenerateURN

func GenerateURN(nid string) string

func IsDir

func IsDir(path string) bool

IsDir checks if the given input is a directory. It returns true if the input is a directory, false otherwise.

func IsDirExists

func IsDirExists(path string) (bool, error)

IsDirExists checks if a directory exists and is valid.

func IsFileExists

func IsFileExists(path string) (bool, error)

IsFileExists checks if a file exists and is valid.

func SaveToFile

func SaveToFile(data interface{}, path, format string) error

func SplitAndAppendStrings

func SplitAndAppendStrings(target []string) []string

func SplitContentsByEmptyLine

func SplitContentsByEmptyLine(contents string) []string

func SplitString

func SplitString(str string) []string

func StringSliceContains

func StringSliceContains(s []string, e string) bool

StringSliceContains checks if a string slice contains specified string

func ToJSON

func ToJSON(t interface{}) ([]byte, error)

func ToTitle

func ToTitle(str string) string

func ToXML

func ToXML(data interface{}) ([]byte, error)

func ToYAML

func ToYAML(t interface{}) ([]byte, error)

func WriteFile

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

func WriteYAML

func WriteYAML(t interface{}, path string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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