utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelcaseToPascalCase added in v0.1.1

func CamelcaseToPascalCase(s string) string

CamelcaseToPascalCase converts a camelCase string to PascalCase.

func ConnectionURLBuilder

func ConnectionURLBuilder(n string) (string, error)

ConnectionURLBuilder func for building URL connection.

func Decrypt added in v0.1.0

func Decrypt(key, ciphertext string) (string, error)

Decrypt decrypts the given ciphertext using the provided key.

func Encrypt added in v0.1.0

func Encrypt(key, plaintext string) (string, error)

Encrypt encrypts the given plaintext using the provided key.

func ErrorHandler

func ErrorHandler(c *fiber.Ctx, err error) error

ErrorHandler is a custom error handler for Fiber.

func NewValidator

func NewValidator() *validator.Validate

NewValidator func for create a new validator for model fields.

validate := utils.NewValidator()
if err := validate.Struct(object); err != nil { }

func PascalCaseToCamelcase added in v0.0.5

func PascalCaseToCamelcase(s string) string

PascalCaseToCamelcase converts a PascalCase string to camelCase.

func StartServer

func StartServer(a *fiber.App)

StartServer func for starting a simple server.

func StartServerWithGracefulShutdown

func StartServerWithGracefulShutdown(a *fiber.App)

StartServerWithGracefulShutdown function for starting server with a graceful shutdown.

func StringToUint added in v0.0.5

func StringToUint(s string) (uint, error)

StringToUint function to convert string to uint.

func ValidatorErrors

func ValidatorErrors(err error) map[string]string

ValidatorErrors func for show validation errors for each invalid fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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