middlewares

package
v0.0.0-...-ec6daaa Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth(ctx context.Context, authServiceURL string) bool

Types

type AuthenticationMiddleware

type AuthenticationMiddleware struct {
	Next service.Service
}

func (*AuthenticationMiddleware) Create

func (*AuthenticationMiddleware) Delete

func (a *AuthenticationMiddleware) Delete(ctx context.Context, id uint) (string, error)

func (*AuthenticationMiddleware) GetByID

func (*AuthenticationMiddleware) QuantityOrdered

func (a *AuthenticationMiddleware) QuantityOrdered(ctx context.Context, id uint) (uint, error)

func (*AuthenticationMiddleware) Search

func (a *AuthenticationMiddleware) Search(ctx context.Context, search string, startDate time.Time, endDate time.Time) ([]database.OrderOut, error)

func (*AuthenticationMiddleware) Top

func (*AuthenticationMiddleware) Total

type InstrumentingMiddleware

type InstrumentingMiddleware struct {
	RequestCount   metrics.Counter
	RequestLatency metrics.Histogram
	Next           service.Service
}

func (*InstrumentingMiddleware) Create

func (i *InstrumentingMiddleware) Create(ctx context.Context, data database.OrderIn) (msg string, err error)

func (*InstrumentingMiddleware) Delete

func (i *InstrumentingMiddleware) Delete(ctx context.Context, id uint) (msg string, err error)

func (*InstrumentingMiddleware) GetByID

func (i *InstrumentingMiddleware) GetByID(ctx context.Context, id uint) (order []database.OrderItemOut, err error)

func (*InstrumentingMiddleware) QuantityOrdered

func (i *InstrumentingMiddleware) QuantityOrdered(ctx context.Context, id uint) (qty uint, err error)

func (*InstrumentingMiddleware) Search

func (i *InstrumentingMiddleware) Search(ctx context.Context, search string, startDate time.Time, endDate time.Time) (orders []database.OrderOut, err error)

func (*InstrumentingMiddleware) Top

func (i *InstrumentingMiddleware) Top(ctx context.Context, count uint) (top []database.ProductOutTop, err error)

func (*InstrumentingMiddleware) Total

func (i *InstrumentingMiddleware) Total(ctx context.Context) (total float32, err error)

type LoggingMiddleware

type LoggingMiddleware struct {
	Logger log.Logger
	Next   service.Service
}

func (*LoggingMiddleware) Create

func (l *LoggingMiddleware) Create(ctx context.Context, data database.OrderIn) (msg string, err error)

func (*LoggingMiddleware) Delete

func (l *LoggingMiddleware) Delete(ctx context.Context, id uint) (msg string, err error)

func (*LoggingMiddleware) GetByID

func (l *LoggingMiddleware) GetByID(ctx context.Context, id uint) (order []database.OrderItemOut, err error)

func (*LoggingMiddleware) QuantityOrdered

func (l *LoggingMiddleware) QuantityOrdered(ctx context.Context, id uint) (qty uint, err error)

func (*LoggingMiddleware) Search

func (l *LoggingMiddleware) Search(ctx context.Context, search string, startDate time.Time, endDate time.Time) (orders []database.OrderOut, err error)

func (*LoggingMiddleware) Top

func (l *LoggingMiddleware) Top(ctx context.Context, count uint) (products []database.ProductOutTop, err error)

func (*LoggingMiddleware) Total

func (l *LoggingMiddleware) Total(ctx context.Context) (total float32, err error)

Jump to

Keyboard shortcuts

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