common

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package common provides shared HTTP utility functions for API handlers.

Package common provides shared HTTP utility functions for API handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAndValidateServerNameParam added in v0.3.7

func GetAndValidateServerNameParam(r *http.Request, paramName string) (string, error)

GetAndValidateServerNameParam extracts and validates a server name from URL params. Validates reverse-DNS format: namespace/name

func GetAndValidateURLParam added in v0.3.3

func GetAndValidateURLParam(r *http.Request, paramName string) (string, error)

GetAndValidateURLParam extracts, decodes, and validates a URL parameter from the request. Returns the decoded value or an error if invalid. Validation rules: - Must not be empty after trimming whitespace - Must not contain any whitespace characters

func WriteErrorResponse

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

WriteErrorResponse writes a standardized error response

func WriteJSONResponse

func WriteJSONResponse(w http.ResponseWriter, data any, statusCode int)

WriteJSONResponse writes a JSON response with the given data

Types

This section is empty.

Jump to

Keyboard shortcuts

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