context

package
v0.2.1-0...-b9ab31a Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseContext

type BaseContext struct {
	fc.Context
	Index   int8
	Filters fc.FilterChain
	Timeout time.Duration
	Ctx     context.Context

	// the response context will return.
	TargetResp *client.Response
	// client call response.
	SourceResp interface{}
	// happen error
	Err error
}

BaseContext

func NewBaseContext

func NewBaseContext() *BaseContext

NewBaseContext create base context.

func (*BaseContext) Abort

func (c *BaseContext) Abort()

Abort filter chain break , filter after the current filter will not executed.

func (*BaseContext) AbortWithError

func (c *BaseContext) AbortWithError(message string, err error)

AbortWithError filter chain break , filter after the current filter will not executed. And log will print.

func (*BaseContext) AppendFilterFunc

func (c *BaseContext) AppendFilterFunc(ff ...fc.FilterFunc)

AppendFilterFunc append filter func.

func (*BaseContext) Next

func (c *BaseContext) Next()

Next should be used only inside middleware. It executes the pending handlers in the chain inside the calling handler. See example in GitHub.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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