response

package
v0.0.0-...-89dfdfc Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyResponse

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

func Empty

func Empty() *EmptyResponse

func (*EmptyResponse) AsBytes

func (r *EmptyResponse) AsBytes() []byte

func (*EmptyResponse) Code

func (r *EmptyResponse) Code() int

func (*EmptyResponse) Headers

func (r *EmptyResponse) Headers() *use.Collection[string, string]

func (*EmptyResponse) WithCode

func (r *EmptyResponse) WithCode(code int) *EmptyResponse

func (*EmptyResponse) WithHeader

func (r *EmptyResponse) WithHeader(key string, value string) *EmptyResponse

type JsonResponse

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

func Json

func Json(obj interface{}) *JsonResponse

func (*JsonResponse) AsBytes

func (r *JsonResponse) AsBytes() []byte

func (*JsonResponse) Code

func (r *JsonResponse) Code() int

func (*JsonResponse) Headers

func (r *JsonResponse) Headers() *use.Collection[string, string]

func (*JsonResponse) WithCode

func (r *JsonResponse) WithCode(code int) *JsonResponse

func (*JsonResponse) WithHeader

func (r *JsonResponse) WithHeader(key string, value string) *JsonResponse

type RedirectResponse

type RedirectResponse struct {
	To string
	// contains filtered or unexported fields
}

func Redirect

func Redirect(to string) *RedirectResponse

func (*RedirectResponse) AsBytes

func (r *RedirectResponse) AsBytes() []byte

func (*RedirectResponse) Code

func (r *RedirectResponse) Code() int

func (*RedirectResponse) Headers

func (r *RedirectResponse) Headers() *use.Collection[string, string]

func (*RedirectResponse) WithCode

func (r *RedirectResponse) WithCode(code int) *RedirectResponse

type Response

type Response interface {
	AsBytes() []byte
	Headers() *use.Collection[string, string]
	Code() int
}

func NewResponse

func NewResponse(arg interface{}) Response

type StringResponse

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

func String

func String(body string) *StringResponse

func (*StringResponse) AsBytes

func (r *StringResponse) AsBytes() []byte

func (*StringResponse) Code

func (r *StringResponse) Code() int

func (*StringResponse) Headers

func (r *StringResponse) Headers() *use.Collection[string, string]

func (*StringResponse) WithCode

func (r *StringResponse) WithCode(code int) *StringResponse

type ViewResponse

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

func View

func View(template string) *ViewResponse

func (*ViewResponse) AsBytes

func (r *ViewResponse) AsBytes() []byte

func (*ViewResponse) AsString

func (r *ViewResponse) AsString() string

func (*ViewResponse) Code

func (r *ViewResponse) Code() int

func (*ViewResponse) GetAllData

func (r *ViewResponse) GetAllData() any

func (*ViewResponse) GetEngine

func (r *ViewResponse) GetEngine() *view.Engine

func (*ViewResponse) Headers

func (r *ViewResponse) Headers() *use.Collection[string, string]

func (*ViewResponse) WithCode

func (r *ViewResponse) WithCode(code int) *ViewResponse

func (*ViewResponse) WithData

func (r *ViewResponse) WithData(data map[string]interface{}) *ViewResponse

func (*ViewResponse) WithHeader

func (r *ViewResponse) WithHeader(key string, value string) *ViewResponse

func (*ViewResponse) WithLayout

func (r *ViewResponse) WithLayout(layout string) *ViewResponse

Jump to

Keyboard shortcuts

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