Documentation ¶
Overview ¶
package rkmidpanic provide options
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeforeCtx ¶
type BeforeCtx struct { Input struct { Event rkquery.Event Logger *zap.Logger PanicHandler func(resp *rkerror.ErrorResp) } Output struct { DeferFunc func() } }
BeforeCtx context for Before() function
func NewBeforeCtx ¶
func NewBeforeCtx() *BeforeCtx
NewBeforeCtx create new BeforeCtx with fields initialized
type Option ¶
type Option func(*optionSet)
Option is for middleware while creating
func WithEntryNameAndType ¶
WithEntryNameAndType Provide entry name and entry type.
func WithMockOptionSet ¶
func WithMockOptionSet(mock OptionSetInterface) Option
WithMockOptionSet provide mock OptionSetInterface
type OptionSetInterface ¶
type OptionSetInterface interface { GetEntryName() string GetEntryType() string Before(*BeforeCtx) BeforeCtx(event rkquery.Event, logger *zap.Logger, handler handlerFunc) *BeforeCtx }
OptionSetInterface mainly for testing purpose
func NewOptionSet ¶
func NewOptionSet(opts ...Option) OptionSetInterface
NewOptionSet Create new optionSet with options.
func NewOptionSetMock ¶
func NewOptionSetMock(before *BeforeCtx) OptionSetInterface
NewOptionSetMock for testing purpose
Click to show internal directories.
Click to hide internal directories.