handlers

package
v0.0.0-...-9989a6e Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminToken = "admin_token"
	UserToken  = "user_token"
)

Variables

View Source
var (
	ErrBannerIncorrectData = errors.New("incorrect banner data")
	ErrUserNotAuthorized   = errors.New("user not authorized")
	ErrUserNotAllowed      = errors.New("user not allowed")
	ErrBannerExists        = errors.New("banner already exists")
)

Functions

func Auth

func Auth(handler http.Handler) http.Handler

func NewBannerHandler

func NewBannerHandler(servo BannerService) *bannerHandler

func Routes

func Routes(bannerHandler *bannerHandler) chi.Router

Types

type BannerService

type BannerService interface {
	CreateBanner(ctx context.Context, banner domain.Banner) (int64, error)
	GetBanners(ctx context.Context, banner domain.BannerFilter) ([]domain.Banner, error)
	GetBanner(ctx context.Context, tagIDs []int64, featureID int64, lastVersion bool, isAdmin bool) ([]domain.Banner, error)
	UpdateBanner(ctx context.Context, banner domain.Banner) error
	DeleteBanner(ctx context.Context, bannerID int64) error
}

Jump to

Keyboard shortcuts

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