core

package
v0.0.0-...-a67f07d Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(storage Storage, cfg *config.Config, queue queue.Queue, logg Logger) *App

func (App) AddBanner

func (a App) AddBanner(description string) error

func (App) AddBannerToSlot

func (a App) AddBannerToSlot(bannerID, slotID int) error

func (App) AddSDGroup

func (a App) AddSDGroup(description string) error

func (App) AddSlot

func (a App) AddSlot(description string) error

func (App) GetBanner

func (a App) GetBanner(slotID, sdGroupID int) (int, error)

func (App) RemoveBanner

func (a App) RemoveBanner(id int) error

func (App) RemoveBannerFromSlot

func (a App) RemoveBannerFromSlot(bannerID, slotID int) error

func (App) RemoveSDGroup

func (a App) RemoveSDGroup(id int) error

func (App) RemoveSlot

func (a App) RemoveSlot(id int) error

func (App) SelectBanner

func (a App) SelectBanner(allTracks map[int]*storage.Tracker) int

func (App) Track

func (a App) Track(bannerID, slotID, sdGroupID int) error

type BannerWithWeight

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

type Event

type Event struct {
	Type      string
	SlotID    int
	BannerID  int
	SDGroupID int
	DateTime  time.Time
}

type Logger

type Logger interface {
	Errorf(format string, args ...interface{})
}

type Storage

type Storage interface {
	Connect(ctx context.Context) error
	Close() error
	AddBanner(description string) error
	RemoveBannerByID(id int) error
	AddSlot(description string) error
	RemoveSlotByID(id int) error
	AddSDGroup(description string) error
	RemoveSDGroupByID(id int) error
	GetAllGroups() ([]*storage.SDGroup, error)
	GetAllTracks(slotID, sdGroupID int) (map[int]*storage.Tracker, error)
	TrackClick(bannerID, slotID, sdGroupID int) error
	TrackView(bannerID, slotID, sdGroupID int) error
	AddTrack(bannerID, slotID, sdGroupID int) error
	RemoveTracks(bannerID, slotID int) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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