errors

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	HTTPCode int    `json:"-"`
	Code     string `json:"code"`
	Message  string `json:"message"`
	Detail   any    `json:"detail"`
}

Error is a struct for a Docker-compatible error

func NewError

func NewError(code, message string, details ...any) *Error

NewError creates a new DockerError

func (*Error) Error

func (e *Error) Error() string

Error returns the error message

type Response

type Response struct {
	Errors []*Error `json:"errors"`
}

Response is a struct for Docker error response

func NewResponse

func NewResponse(httpCode int, details ...any) *Response

NewResponse creates a new DockerErrorResponse

func (*Response) WriteTo

func (e *Response) WriteTo(ctx context.Context, w http.ResponseWriter)

WriteTo writes the error response to the http.ResponseWriter

Jump to

Keyboard shortcuts

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