problem

package module
v0.0.0-...-bbfbf6d Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 4 Imported by: 0

README

problems

golang implementation of application/problem+json

Documentation

Index

Constants

View Source
const MediaType = "application/problem+json"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func Custom

func Custom(key string, value any) Option

func Detail

func Detail(detail string) Option

func Ext

func Ext(key string, value any) Option

func Instance

func Instance(uri string) Option

func Status

func Status(status int) Option

func Title

func Title(title string) Option

func Type

func Type(uri string) Option

func Wrap

func Wrap(err error) Option

func WrapPublic

func WrapPublic(err error) Option

type Problem

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

func New

func New(opts ...Option) *Problem

func Of

func Of(status int) *Problem

func (*Problem) Append

func (p *Problem) Append(opts ...Option) *Problem

func (*Problem) Data

func (p *Problem) Data() map[string]any

func (*Problem) Error

func (p *Problem) Error() string

func (*Problem) Get

func (p *Problem) Get(key string) (any, bool)

func (*Problem) Is

func (p *Problem) Is(target error) bool

func (*Problem) JSON

func (p *Problem) JSON() []byte

func (*Problem) JSONString

func (p *Problem) JSONString() string

func (*Problem) MarshalJSON

func (p *Problem) MarshalJSON() ([]byte, error)

func (*Problem) UnmarshalJSON

func (p *Problem) UnmarshalJSON(b []byte) error

func (*Problem) Unwrap

func (p *Problem) Unwrap() error

func (*Problem) With

func (p *Problem) With(key string, value any) *Problem

func (*Problem) WriteHeaderTo

func (p *Problem) WriteHeaderTo(w http.ResponseWriter)

func (*Problem) WriteTo

func (p *Problem) WriteTo(w http.ResponseWriter) (int, error)

Jump to

Keyboard shortcuts

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