middleware

package
v0.0.0-...-553ec8c Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilConfig = errors.New("cannot override nil config")

Functions

This section is empty.

Types

type Config

type Config struct {
	IdempotencyCfg *IdempotencyConfig
}

Config represents the main configuration structure.

type IdempotencyConfig

type IdempotencyConfig struct {
	Name      string
	HeaderKey string
}

IdempotencyConfig defines the configuration for idempotency behavior.

type Manager

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

Manager represents a manager for HTTP middlewares.

func NewMiddlewareManager

func NewMiddlewareManager(cfg *Config, log logger.Logger, r *redis.Redis) (*Manager, error)

NewMiddlewareManager creates a new instance of MiddlewareManager.

func (*Manager) AddIdempotenceMiddleware

func (mm *Manager) AddIdempotenceMiddleware()

AddIdempotenceMiddleware adds idempotence middleware to the middleware chain.

func (*Manager) SetupGlobalMiddleware

func (mm *Manager) SetupGlobalMiddleware(swaggerSpec *loads.Document, api *operations.TransactionAPI)

SetupGlobalMiddleware sets up global middleware based on Swagger specification.

Jump to

Keyboard shortcuts

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