api

package
v0.0.0-...-93660c8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeOptString

func MakeOptString(v string) *string

MakeOptString converts a string to its pointer if it's not a zero value.

func MakeString

func MakeString(v *string) string

MakeString converts a string pointer to a string or a zero value if it's nil.

Types

type ErrorHandler

type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error)

ErrorHandler handles translating errors to HTTP responses.

type HTTPError

type HTTPError struct {
	// Err is the wrapped error.
	Err error
	// Status is the HTTP status code.
	Status int
	// Type is the OpenAPI error type, may be empty.
	Type string
}

HTTPError is an error wrapper carrying an HTTP status code.

func (*HTTPError) Error

func (he *HTTPError) Error() string

Error returns the string representation of the error.

func (*HTTPError) Unwrap

func (he *HTTPError) Unwrap() error

Unwrap returns the wrapped error.

Directories

Path Synopsis
nekos
v2
Package v2 provides primitives to interact with the openapi HTTP API.
Package v2 provides primitives to interact with the openapi HTTP API.
Package v1 provides primitives to interact with the openapi HTTP API.
Package v1 provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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