chain

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Logger *slog.Logger
	// contains filtered or unexported fields
}

func (*Chain) Handle

func (chain *Chain) Handle(ctx context.Context, opts ...Option) error

func (*Chain) LoadMeta added in v0.3.8

func (chain *Chain) LoadMeta() (any, bool)

get instance global meta

func (*Chain) StoreMeta added in v0.3.8

func (chain *Chain) StoreMeta(v any)

set instance global meta

func (*Chain) Use

func (chain *Chain) Use(handlers ...Handler)

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func (*Context) Abort

func (c *Context) Abort()

func (*Context) AbortWithError

func (c *Context) AbortWithError(err error)

func (*Context) Error

func (c *Context) Error() error

func (*Context) IsAborted

func (c *Context) IsAborted() bool

func (*Context) Load added in v0.3.8

func (c *Context) Load() (any, bool)

func (*Context) LoadMeta added in v0.3.8

func (c *Context) LoadMeta() (any, bool)

get instance global meta

func (*Context) Logger

func (c *Context) Logger() *slog.Logger

func (*Context) Next

func (c *Context) Next()

func (*Context) Request added in v0.3.8

func (c *Context) Request() (any, bool)

func (*Context) Store added in v0.3.8

func (c *Context) Store(v any)

func (*Context) StoreMeta added in v0.3.8

func (c *Context) StoreMeta(v any)

set instance global meta

type Handler

type Handler interface {
	Name() string
	Execute(*Context)
}

type Option added in v0.3.8

type Option func(*Context)

func WithRequest added in v0.3.8

func WithRequest(req any) Option

unmarshal and set request

Jump to

Keyboard shortcuts

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