common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRequestPayload

func BindRequestPayload[S any](c *fiber.Ctx) *S

func FiberConfig

func FiberConfig(disableStartupMsg bool) fiber.Config

func GrpcConfig

func GrpcConfig(p any) (err error)

func Validate

func Validate(s interface{}) []*common.ErrorResponse

Types

type ErrorHandlingBehavior

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

func NewErrorHandlingBehavior added in v0.1.5

func NewErrorHandlingBehavior(log *zerolog.Logger, settings *config.Settings) ErrorHandlingBehavior

func (ErrorHandlingBehavior) Process

func (p ErrorHandlingBehavior) Process(ctx context.Context, msg mediator.Message, next mediator.Next) (interface{}, error)

Process checks for errors in the pipeline to increment metrics and log in standard fashion

type LoggingBehavior

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

func NewLoggingBehavior added in v0.1.5

func NewLoggingBehavior(log *zerolog.Logger, settings *config.Settings) LoggingBehavior

func (LoggingBehavior) Process

func (p LoggingBehavior) Process(ctx context.Context, msg mediator.Message, next mediator.Next) (interface{}, error)

type ProblemDetails

type ProblemDetails struct {
	Type   string      `json:"type"`
	Title  string      `json:"title"`
	Status int         `json:"status"`
	Detail interface{} `json:"detail"`
}

type ValidationBehavior

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

func NewValidationBehavior added in v0.1.5

func NewValidationBehavior(log *zerolog.Logger, settings *config.Settings) ValidationBehavior

func (ValidationBehavior) Process

func (p ValidationBehavior) Process(ctx context.Context, msg mediator.Message, next mediator.Next) (interface{}, error)

Process validation check for all requests going through mediator. Logs if validation fails.

Jump to

Keyboard shortcuts

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