resp

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T any](store *store.Store, opts ...Option) *v3.Response

New builds a response for T with the provided description. Unless T is op.NoContent, it adds an application/json media type by default.

Types

type Option

type Option func(*v3.Response, *store.Store)

Option configures an OpenAPI response. May be returned from a type implementing the Response interface:

func (T) Response() Option

func ContentType

func ContentType[T any](contentType string, opts ...mediatype.Option) Option

ContentType adds a typed content entry to the response. Use this to add content types beyond the default application/json set by op.Response[T].

func Description

func Description(s string) Option

Description overrides the response description.

func Header[T any](name string, opts ...header.Option) Option

Header adds a typed header to the response.

func Link(name string, opts ...link.Option) Option

Link adds a design-time link to the response.

func Options

func Options(opts ...Option) Option

Options combines multiple options into one.

func Reference

func Reference(name string) Option

Reference sets a $ref to a named response component in components/responses.

func Summary

func Summary(s string) Option

Summary sets a short summary of the response.

type Response

type Response interface {
	Response() Option
}

Response may be implemented to set default response options on a type.

func (T) Response() resp.Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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