statuscodes

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusCategory

type StatusCategory int
const (
	CategoryOK          StatusCategory = 1
	CategoryClientError StatusCategory = 2
	CategoryServerError StatusCategory = 3
)

func (StatusCategory) String

func (i StatusCategory) String() string

type StatusCode

type StatusCode int
const (
	OK StatusCode = 600

	// Client-caused error responses
	BadRequest   StatusCode = 700
	Unauthorized StatusCode = 701
	Forbidden    StatusCode = 702
	NotFound     StatusCode = 703
	Conflict     StatusCode = 704
	RateLimited  StatusCode = 705

	// Server-caused error responses
	InternalServerError StatusCode = 800
	NotImplemented      StatusCode = 801
	Unavailable         StatusCode = 802
	UnknownError        StatusCode = 803
)

1. Keep OK not as zero so you know someone affirmatively picked it 2. Don't overlap with HTTP error codes so people know that these are different

func (StatusCode) Category

func (re StatusCode) Category() StatusCategory

func (StatusCode) String

func (i StatusCode) String() string

Jump to

Keyboard shortcuts

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