response

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Content     []byte
	ContentType string
}

type Raw

type Raw struct {
	Data any
}

type Redirect

type Redirect struct {
	URL string
}

type Response

type Response struct {
	Data    any               `json:"data"`
	Meta    map[string]any    `json:"meta,omitempty"`
	Headers map[string]string `json:"-"`
}

func (Response) SetCustomHeaders

func (resp Response) SetCustomHeaders(w http.ResponseWriter)

type Template

type Template struct {
	Data any
	Name string
}

func (*Template) Render

func (t *Template) Render(w io.Writer)

type XML

type XML struct {
	Content     []byte
	ContentType string
}

XML represents a response that should be sent as XML without JSON encoding. If ContentType is empty, Responder defaults it to application/xml.

Jump to

Keyboard shortcuts

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