status

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package status various server status code containing more information why the request failed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string

Code used for indicating various server errors to the frontend

const (
	CodeServerError       Code = "server_error"
	CodeModrinthError     Code = "modrinth_error"
	CodeModrinthDown      Code = "modrinth_down"
	CodeModrinthRateLimit Code = "modrinth_rate_limit"
	CodeModrinthNotFound  Code = "modrinth_not_found"
	CodeCurseError        Code = "curse_error"
	CodeCurseDown         Code = "curse_down"
	CodeCurseRateLimit    Code = "curse_rate_limit"
	CodeCurseNotFound     Code = "curse_not_found"
)

Error Status codes

type RateLimit

type RateLimit struct {
	Reset time.Time `json:"reset"`
}

RateLimit additional data for

type Status

type Status struct {
	Code  Code        `json:"code"`
	Trace string      `json:"trace"`
	Data  interface{} `json:"data"`
}

Status used for indicating various server errors to the frontend

type Statuses

type Statuses []Status

Statuses is a list of Status

func NewServerErrors

func NewServerErrors() Statuses

func (Statuses) Append

func (s Statuses) Append(statuses Statuses) Statuses

Append add statuses to the existing statuses If both existing and appending statuses are nil, this function returns nil

Jump to

Keyboard shortcuts

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