status

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package status provides HTTP and application status code constants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusCode

type StatusCode int

StatusCode represents an HTTP or application-level status code.

const (
	// OK is the status code for successful requests (HTTP 200).
	OK StatusCode = http.StatusOK
	// Unknown is the status code for unknown errors (HTTP 500).
	Unknown StatusCode = http.StatusInternalServerError
	// InternalServerError is the status code for internal server errors (HTTP 500).
	InternalServerError StatusCode = http.StatusInternalServerError
	// BadRequest is the status code for bad request errors (HTTP 400).
	BadRequest StatusCode = http.StatusBadRequest
	// DuplicateRequest is the status code for duplicate/too many requests (HTTP 429).
	DuplicateRequest StatusCode = http.StatusTooManyRequests
	// NotFound is the status code for not found errors (HTTP 404).
	NotFound StatusCode = http.StatusNotFound
)

func (StatusCode) Int added in v0.15.0

func (s StatusCode) Int() int

Int returns the status code as a plain integer.

func (StatusCode) String

func (s StatusCode) String() string

String returns a formatted string representation of the status code (e.g. "200-OK").

Jump to

Keyboard shortcuts

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