response

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextResponseType

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

func (ContextResponseType) ContentType

func (t ContextResponseType) ContentType() (string, error)

ContentType returns content type retrieved from func usage context. It's empty for Redirect and NoContent

func (ContextResponseType) StatusCode

func (t ContextResponseType) StatusCode() (int, error)

func (ContextResponseType) TypeName

func (t ContextResponseType) TypeName() (string, error)

func (ContextResponseType) TypePkgPath

func (t ContextResponseType) TypePkgPath() (string, error)

type Response

type Response struct {
	// ContentType is a content type retrieved from func usage context. It's empty for Redirect and NoContent
	ContentType string
	// TypeName is a type name like it's used in code, with package name as prefix (except for std types).
	//Field is empty for responses with empty body
	TypeName string
	// TypePkgPath is a full pkg path for type. Field is empty for responses with empty body
	TypePkgPath string
}

type StatusCodeMapping

type StatusCodeMapping map[int][]Response

func NewStatusCodeMapping

func NewStatusCodeMapping(
	funcDecl *ast.FuncDecl,
	cr *codes.Resolver,
	mr *mime.Resolver,
	typesInfo *types.Info,
) StatusCodeMapping

NewStatusCodeMapping builds StatusCodeMapping from provided handler function declaration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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