utils

package
v0.0.0-...-de93bbd Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomString

func RandomString(length int) (string, error)

RandomString generates a string with the given length using crypt/rand

func WriteJSONError

func WriteJSONError(w http.ResponseWriter, message string, statusCode int)

Types

type CustomError

type CustomError struct {
	Message string
}

func (*CustomError) Error

func (e *CustomError) Error() string

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    int    `json:"code,omitempty"`
}

Jump to

Keyboard shortcuts

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