types

package
v0.0.0-...-47cd478 Latest Latest
Warning

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

Go to latest
Published: May 15, 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 Error

type Error struct {
	// contains filtered or unexported fields
}

Error represents a status code as an error containing another error.

func NewError

func NewError(code int, err error) *Error

NewError returns *Error that contains code and err. err must not be nil.

func (*Error) Error

func (exit *Error) Error() string

Error returns the same result of exit.Unwrap().Error().

func (*Error) StatusCode

func (exit *Error) StatusCode() int

StatusCode returns the status code that exit contains.

func (*Error) Unwrap

func (exit *Error) Unwrap() error

Unwrap returns the error that exit contains.

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status represents a status code as an error.

func NewStatus

func NewStatus(code int) Status

NewStatus returns Status that contains code.

func (Status) Error

func (exit Status) Error() string

Error returns the string of "status {{exit.StatusCode()}}".

func (Status) StatusCode

func (exit Status) StatusCode() int

StatusCode returns the status code that exit contains.

type StatusCoder

type StatusCoder interface {
	// StatusCode returns the status code.
	StatusCode() int
}

StatusCoder is the interface of type that has an status code.

Jump to

Keyboard shortcuts

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