header

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 6 Imported by: 0

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.Header

New builds a response header for T.

Types

type Header interface {
	Header() Option
}

Header may be implemented to set default header options on a type.

func (T) Header() header.Option

type Option

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

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

func (T) Header() Option

func AllowEmptyValue

func AllowEmptyValue() Option

AllowEmptyValue allows sending an empty value for the header. Default: false.

func AllowReserved

func AllowReserved() Option

AllowReserved allows reserved URI characters in the header value. Default: false.

func Deprecated

func Deprecated() Option

Deprecated marks the header as deprecated. Default: false.

func Description

func Description(s string) Option

Description sets the header description.

func Example

func Example(v any) Option

Example sets an example value for the header.

func Explode

func Explode() Option

Explode controls whether arrays and objects generate separate header instances. Default: false (simple is the only valid style for headers).

func NamedExample

func NamedExample(name string, value any, opts ...example.Option) Option

NamedExample adds a named example to the header.

func NamedExampleRef

func NamedExampleRef(name, ref string) Option

NamedExampleRef adds a named example $ref to the header.

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 header component in components/headers.

func Required

func Required(v bool) Option

Required sets whether the header is required. Default: false.

func Style

func Style(s string) Option

Style sets the serialization style for the header.

Jump to

Keyboard shortcuts

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