periHttp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: AGPL-3.0 Imports: 6 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeriHttp

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

func New

func New(w http.ResponseWriter, r *http.Request, role rbac.Role) PeriHttp

func (*PeriHttp) BinaryResponse

func (p *PeriHttp) BinaryResponse(httpStatusCode int, data []byte) error

func (*PeriHttp) EmptyResponse

func (p *PeriHttp) EmptyResponse(httpStatusCode int)

func (*PeriHttp) FlushResp

func (p *PeriHttp) FlushResp(w http.ResponseWriter)

func (*PeriHttp) IsAuthorized

func (p *PeriHttp) IsAuthorized(role rbac.Role) bool

func (*PeriHttp) JsonResponse

func (p *PeriHttp) JsonResponse(httpStatusCode int, jsonObject any) error

func (*PeriHttp) ReadBody

func (p *PeriHttp) ReadBody() ([]byte, error)

func (*PeriHttp) Req

func (p *PeriHttp) Req() *http.Request

func (*PeriHttp) Resp

func (p *PeriHttp) Resp() http.ResponseWriter

func (*PeriHttp) Role

func (p *PeriHttp) Role() rbac.Role

func (*PeriHttp) SetCookie

func (p *PeriHttp) SetCookie(cookie *http.Cookie)

func (*PeriHttp) SetReq

func (p *PeriHttp) SetReq(r *http.Request)

func (*PeriHttp) SetResp

func (p *PeriHttp) SetResp(w http.ResponseWriter)

func (*PeriHttp) SetRole

func (p *PeriHttp) SetRole(role rbac.Role)

func (*PeriHttp) TextResponse

func (p *PeriHttp) TextResponse(httpStatusCode int, textMessage any) error

func (*PeriHttp) Vars

func (p *PeriHttp) Vars() map[string]string

Jump to

Keyboard shortcuts

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