responseutil

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectResponseState

func InjectResponseState(ctx *http.RequestCtx, state ResponseState)

Types

type ResponseFlag

type ResponseFlag int
const (
	// response flag
	SUCCESS ResponseFlag = iota
	FAILURE

	UNKNOWN ResponseFlag = -1
)

type ResponseState

type ResponseState interface {
	Flag() ResponseFlag
	StatusCode() int
}

func CreateResponseState

func CreateResponseState(flag ResponseFlag, statusCode int) ResponseState

func ExtractResponseState

func ExtractResponseState(ctx *http.RequestCtx) ResponseState

type ResponseStateImpl

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

func (*ResponseStateImpl) Flag

func (r *ResponseStateImpl) Flag() ResponseFlag

func (*ResponseStateImpl) StatusCode

func (r *ResponseStateImpl) StatusCode() int

Jump to

Keyboard shortcuts

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