sender

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT, MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Error string `json:"error"`
}

type ExtendableSend

type ExtendableSend interface {
	Header() http.Header
	Empty() error
	Error(e any) error
	Json(value any) error
	Html(value string) error
	Xml(value any) error
	Text(value string) error
	Bool(value bool) error
	Redirect(url string) error
	File(name string, bytes []byte) error
	Asset(name string, bytes []byte) error
}

type Json

type Json struct {
	Result any `json:"result"`
}

type Send

type Send interface {
	Status(statusCode int) Send
}

type Sender

type Sender struct {
	Bytes       []byte
	DataType    string
	ContentType string
	Value       string
	StatusCode  int
	// contains filtered or unexported fields
}

func New

func New(request *http.Request, response http.ResponseWriter, write ...*bool) *Sender

func (*Sender) Asset

func (s *Sender) Asset(name string, bytes []byte) error

func (*Sender) Bool

func (s *Sender) Bool(value bool) error

func (*Sender) Empty

func (s *Sender) Empty() error

func (*Sender) Error

func (s *Sender) Error(e any) error

func (*Sender) File

func (s *Sender) File(name string, bytes []byte) error

func (*Sender) Header

func (s *Sender) Header() http.Header

func (*Sender) Html

func (s *Sender) Html(value string) error

func (*Sender) Json

func (s *Sender) Json(value any) error

func (*Sender) Redirect

func (s *Sender) Redirect(url string) error

func (*Sender) Status

func (s *Sender) Status(statusCode int) Send

func (*Sender) Text

func (s *Sender) Text(value string) error

func (*Sender) Xml

func (s *Sender) Xml(value any) error

Jump to

Keyboard shortcuts

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