middleware

package
v1.0.0-dev.81 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyContext

type AnyContext[R any] struct {
	// contains filtered or unexported fields
}

func NewAnyContext

func NewAnyContext[R any](name string, id string, m ...AnyMiddleware[R]) *AnyContext[R]

func (*AnyContext[R]) GetContext

func (c *AnyContext[R]) GetContext() context.Context

func (*AnyContext[R]) GetID

func (c *AnyContext[R]) GetID() string

func (*AnyContext[R]) GetName

func (c *AnyContext[R]) GetName() string

func (*AnyContext[R]) Next

func (c *AnyContext[R]) Next(exec AnyExecFunc[R], returnFunc AnyReturnFunc[R]) R

func (*AnyContext[R]) SetContext

func (c *AnyContext[R]) SetContext(ctx context.Context)

func (*AnyContext[R]) SetID

func (c *AnyContext[R]) SetID(id string)

type AnyErrorContext

type AnyErrorContext[R any] struct {
	// contains filtered or unexported fields
}

func NewAnyErrorContext

func NewAnyErrorContext[R any](name string, id string, m ...AnyErrorMiddleware[R]) *AnyErrorContext[R]

func (*AnyErrorContext[R]) GetContext

func (c *AnyErrorContext[R]) GetContext() context.Context

func (*AnyErrorContext[R]) GetID

func (c *AnyErrorContext[R]) GetID() string

func (*AnyErrorContext[R]) GetName

func (c *AnyErrorContext[R]) GetName() string

func (*AnyErrorContext[R]) Next

func (c *AnyErrorContext[R]) Next(exec AnyErrorExecFunc[R], returnFunc AnyErrorReturnFunc[R]) (R, error)

func (*AnyErrorContext[R]) SetContext

func (c *AnyErrorContext[R]) SetContext(ctx context.Context)

func (*AnyErrorContext[R]) SetID

func (c *AnyErrorContext[R]) SetID(id string)

type AnyErrorExecFunc

type AnyErrorExecFunc[R any] func(context.Context) (R, error)

type AnyErrorMiddleware

type AnyErrorMiddleware[R any] interface {
	Exec(ctx *AnyErrorContext[R], exec AnyErrorExecFunc[R], returnFunc AnyErrorReturnFunc[R]) (R, error)
}

type AnyErrorReturnFunc

type AnyErrorReturnFunc[R any] func(context.Context, R, error) (R, error)

type AnyErrorWrapper

type AnyErrorWrapper[R any] struct {
	// contains filtered or unexported fields
}

func NewAnyErrorWrapper

func NewAnyErrorWrapper[R any](ctx context.Context, name string, m ...AnyErrorMiddleware[R]) *AnyErrorWrapper[R]

func (*AnyErrorWrapper[R]) Exec

func (w *AnyErrorWrapper[R]) Exec(ctx context.Context, id string, exec AnyErrorExecFunc[R], returnFunc AnyErrorReturnFunc[R]) (r R, err error)

type AnyExecFunc

type AnyExecFunc[R any] func(context.Context) R

type AnyMiddleware

type AnyMiddleware[R any] interface {
	Exec(ctx *AnyContext[R], exec AnyExecFunc[R], returnFunc AnyReturnFunc[R]) R
}

type AnyReturnFunc

type AnyReturnFunc[R any] func(context.Context, R) R

type AnyWrapper

type AnyWrapper[R any] struct {
	// contains filtered or unexported fields
}

func NewAnyWrapper

func NewAnyWrapper[R any](ctx context.Context, name string, m ...AnyMiddleware[R]) *AnyWrapper[R]

func (*AnyWrapper[R]) Exec

func (w *AnyWrapper[R]) Exec(ctx context.Context, id string, exec AnyExecFunc[R], returnFunc AnyReturnFunc[R]) (r R)

type ErrorContext

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

func NewErrorContext

func NewErrorContext(name string, id string, m ...ErrorMiddleware) *ErrorContext

func (*ErrorContext) GetContext

func (c *ErrorContext) GetContext() context.Context

func (*ErrorContext) GetID

func (c *ErrorContext) GetID() string

func (*ErrorContext) GetName

func (c *ErrorContext) GetName() string

func (*ErrorContext) Next

func (c *ErrorContext) Next(exec ErrorExecFunc, returnFunc ErrorReturnFunc) error

func (*ErrorContext) SetContext

func (c *ErrorContext) SetContext(ctx context.Context)

func (*ErrorContext) SetID

func (c *ErrorContext) SetID(id string)

type ErrorExecFunc

type ErrorExecFunc func(context.Context) error

type ErrorMiddleware

type ErrorMiddleware interface {
	Exec(ctx *ErrorContext, exec ErrorExecFunc, returnFunc ErrorReturnFunc) error
}

type ErrorReturnFunc

type ErrorReturnFunc func(context.Context, error) error

type ErrorWrapper

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

func NewErrorWrapper

func NewErrorWrapper(ctx context.Context, name string, m ...ErrorMiddleware) *ErrorWrapper

func (*ErrorWrapper) Exec

func (w *ErrorWrapper) Exec(ctx context.Context, id string, exec ErrorExecFunc, returnFunc ErrorReturnFunc) (err error)

Jump to

Keyboard shortcuts

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