middlewares

package
v0.0.0-...-9af728f 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) Categories

func (*AuthenticationMiddleware) Create

func (*AuthenticationMiddleware) Delete

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

func (*AuthenticationMiddleware) GetAll

func (*AuthenticationMiddleware) GetByID

func (*AuthenticationMiddleware) Update

type InstrumentingMiddleware

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

func (*InstrumentingMiddleware) Categories

func (i *InstrumentingMiddleware) Categories(ctx context.Context, id uint) (categories []database.CategoryOut, err error)

func (*InstrumentingMiddleware) Create

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

func (*InstrumentingMiddleware) Delete

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

func (*InstrumentingMiddleware) GetAll

func (*InstrumentingMiddleware) GetByID

func (i *InstrumentingMiddleware) GetByID(ctx context.Context, id uint) (group database.GroupOut, err error)

func (*InstrumentingMiddleware) Update

func (i *InstrumentingMiddleware) Update(ctx context.Context, id uint, data database.GroupIn) (msg string, err error)

type LoggingMiddleware

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

func (*LoggingMiddleware) Categories

func (l *LoggingMiddleware) Categories(ctx context.Context, id uint) (categories []database.CategoryOut, err error)

func (*LoggingMiddleware) Create

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

func (*LoggingMiddleware) Delete

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

func (*LoggingMiddleware) GetAll

func (l *LoggingMiddleware) GetAll(ctx context.Context) (groups []database.GroupOutWithCategories, err error)

func (*LoggingMiddleware) GetByID

func (l *LoggingMiddleware) GetByID(ctx context.Context, id uint) (group database.GroupOut, err error)

func (*LoggingMiddleware) Update

func (l *LoggingMiddleware) Update(ctx context.Context, id uint, data database.GroupIn) (msg string, err error)

Jump to

Keyboard shortcuts

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