postgres

package
v0.0.0-...-2f1b4d8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Banner struct {
	ID          string    `db:"id"`
	SlotID      string    `db:"id_slot"`
	Description string    `db:"description"`
	DateCreated time.Time `db:"date_created"`
}

Banner represents an advertisement element presented in a slot.

type BannerStorage

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

BannerStorage represents a PostgesDB storage.

func New

New creates a new PostgresDB banner storage.

func (*BannerStorage) AckClick

func (bs *BannerStorage) AckClick(ctx context.Context, bannerID, usersID string) error

AckClick increases number of clicks to 1 for specific banner and users group.

func (*BannerStorage) Add

func (bs *BannerStorage) Add(ctx context.Context, b *entities.Banner) error

Add adds new banner to rotation for specific slot.

func (*BannerStorage) Delete

func (bs *BannerStorage) Delete(ctx context.Context, bannerID, slotID string) error

Delete deletes banner from rotation.

func (*BannerStorage) SelectOne

func (bs *BannerStorage) SelectOne(ctx context.Context, slotID, usersID string) (string, error)

SelectOne returns banner to be presented in specific slot at given time for specific users group.

type Slot

type Slot struct {
	ID          string    `db:"id"`
	DateCreated time.Time `db:"date_created"`
}

Slot represents a place on the website where a banner should be presented.

type Statistics

type Statistics struct {
	BannerID    string `db:"id_banner"`
	UsersID     string `db:"id_users"`
	Impressions int    `db:"cnt_impressions"`
	Clicks      int    `db:"cnt_clicks"`
}

Statistics represents banners statistics (impressions and clicks).

type Users

type Users struct {
	ID          string    `db:"id"`
	Name        string    `db:"group_name"`
	DateCreated time.Time `db:"date_created"`
}

Users represents a socio-demographic group of users with relevant interests.

Jump to

Keyboard shortcuts

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