util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbbreviateUUID added in v0.3.0

func AbbreviateUUID(id string) string

AbbreviateUUID returns a shortened representation of a UUID suitable for text output. When the value is not a UUID, the original value is returned unchanged.

func CheckError

func CheckError(err error)

func GenerateSlug added in v0.1.2

func GenerateSlug(title string) string

GenerateSlug converts a title to a URL-friendly slug This matches the Konnect server-side slugify implementation Example: "My API Document" -> "my-api-document"

func GetString added in v0.4.0

func GetString(value *string) string

GetString returns the string value pointed to by value, or an empty string if value is nil.

func GetStringFromReflectValue added in v0.4.0

func GetStringFromReflectValue(v reflect.Value) (string, error)

GetStringFromReflectValue safely extracts a string value from a reflect.Value that may be a string, *string, or nil pointer. Returns empty string if nil or invalid.

func InitDir

func InitDir(path string, mode fs.FileMode) error

InitDir initializes a directory with the given mode

func IsEventGatewayEnabled added in v0.4.0

func IsEventGatewayEnabled() bool

IsEventGatewayEnabled returns true if Event Gateway features are enabled via the KONGCTL_ENABLE_EVENT_GATEWAY environment variable. Accepts standard boolean string values: "1", "t", "T", "TRUE", "true", "True" for true; "0", "f", "F", "FALSE", "false", "False" for false. Empty string is treated as false.

func IsValidUUID added in v0.1.3

func IsValidUUID(s string) bool

IsValidUUID checks if a string is a valid UUID format. It validates the standard 8-4-4-4-12 hexadecimal pattern with dashes.

func StringSliceFromAny added in v0.3.8

func StringSliceFromAny(value any) ([]string, bool)

StringSliceFromAny converts a dynamic value into a string slice. Returns false when the value is not a slice of strings.

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