render

package
v1.0.0-beta.226 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeKey       = "Content-Type"
	ContentTypeJSONValue = "application/json"
	ContentTypeYAMLValue = "application/yaml"
)

Variables

This section is empty.

Functions

func RenderJSON

func RenderJSON[O any](w http.ResponseWriter, o O, opts ...Option) error

RenderJSON renders json object with returned apierrors

func RenderYAML

func RenderYAML[O any](w http.ResponseWriter, o O, opts ...Option) error

Types

type Option

type Option func(w http.ResponseWriter, c *config)

func WithContentType

func WithContentType(contentType string) Option

func WithHeader

func WithHeader(key, value string) Option

func WithStatus

func WithStatus(status int) Option

Jump to

Keyboard shortcuts

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