Documentation
¶
Index ¶
- Variables
- func DeleteCachedAdvert(ctx echo.Context, idents ...string)
- func GenAdvertCondition() db.Compounds
- func GenLink(v Adverter, content string) string
- func GenStyle(p Adverter) string
- func GetAdvertForHTML(ctx echo.Context, idents ...string) interface{}
- func Render(v Adverter) string
- type AdItem
- type AdPosition
- func (f *AdPosition) Add() (pk interface{}, err error)
- func (f *AdPosition) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *AdPosition) Exists(name string, ident string, excludeId uint64) error
- func (f *AdPosition) GetAdvertsByIdent(multilingual bool, idents ...string) (PositionAdverts, error)
- func (f *AdPosition) GetIDByIdent(ident string) (uint64, error)
- func (f *AdPosition) GetOneAdvertByIdent(ident string) (*dbschema.OfficialAdItem, error)
- type AdPublisher
- func (f *AdPublisher) Add() (pk interface{}, err error)
- func (f *AdPublisher) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *AdPublisher) Exists(ownerType string, ownerID uint64) (bool, error)
- func (f *AdPublisher) ExistsOther(ownerType string, ownerID uint64, id uint64) (bool, error)
- type AdSettings
- func (f *AdSettings) Add() (pk interface{}, err error)
- func (f *AdSettings) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *AdSettings) Exists(name string) (bool, error)
- func (f *AdSettings) ExistsOther(name string, id uint64) (bool, error)
- func (f *AdSettings) List(filter Filter, offset, size int) error
- type Adverter
- type CachedAdvert
- type ContentRenderer
- type Filter
- type ItemAndPosition
- func (i *ItemAndPosition) GetContent() string
- func (i *ItemAndPosition) GetContype() string
- func (i *ItemAndPosition) GetDescription() string
- func (i *ItemAndPosition) GetHeight() uint
- func (i *ItemAndPosition) GetTitle() string
- func (i *ItemAndPosition) GetURL() string
- func (i *ItemAndPosition) GetWidth() uint
- type ItemAndRendered
- type ItemResponse
- func (i *ItemResponse) GenHTML() *ItemResponse
- func (i *ItemResponse) GetContent() string
- func (i *ItemResponse) GetContype() string
- func (i *ItemResponse) GetDescription() string
- func (i *ItemResponse) GetHeight() uint
- func (i *ItemResponse) GetTitle() string
- func (i *ItemResponse) GetURL() string
- func (i *ItemResponse) GetWidth() uint
- func (i *ItemResponse) HTML() template.HTML
- type ItemsResponse
- func (i ItemsResponse) First() *ItemResponse
- func (i *ItemsResponse) GenHTML() *ItemsResponse
- func (i ItemsResponse) Last() *ItemResponse
- func (c *ItemsResponse) Place(_ string) *ItemsResponse
- func (i ItemsResponse) Rand() *ItemResponse
- func (i ItemsResponse) Shuffle() ItemsResponse
- func (i ItemsResponse) Size() int
- func (i ItemsResponse) Valid() bool
- type PositionAdverts
- type PositionWithRendered
- func (i *PositionWithRendered) GetContent() string
- func (i *PositionWithRendered) GetContype() string
- func (i *PositionWithRendered) GetDescription() string
- func (i *PositionWithRendered) GetHeight() uint
- func (i *PositionWithRendered) GetTitle() string
- func (i *PositionWithRendered) GetURL() string
- func (i *PositionWithRendered) GetWidth() uint
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Contype = echo.NewKVData() AdMode = echo.NewKVData() )
View Source
var ErrAdSlotDoesNotExist = errors.New(`ad slot does not exist`)
Functions ¶
func DeleteCachedAdvert ¶
func GenAdvertCondition ¶
func GetAdvertForHTML ¶
GetAdvertForHTML(ctx,`home1`).Place(`home1`).HTML()
Types ¶
type AdPosition ¶
type AdPosition struct {
*dbschema.OfficialAdPosition
}
func NewAdPosition ¶
func NewAdPosition(ctx echo.Context) *AdPosition
func (*AdPosition) Add ¶
func (f *AdPosition) Add() (pk interface{}, err error)
func (*AdPosition) Exists ¶
func (f *AdPosition) Exists(name string, ident string, excludeId uint64) error
func (*AdPosition) GetAdvertsByIdent ¶
func (f *AdPosition) GetAdvertsByIdent(multilingual bool, idents ...string) (PositionAdverts, error)
func (*AdPosition) GetIDByIdent ¶
func (f *AdPosition) GetIDByIdent(ident string) (uint64, error)
func (*AdPosition) GetOneAdvertByIdent ¶
func (f *AdPosition) GetOneAdvertByIdent(ident string) (*dbschema.OfficialAdItem, error)
type AdPublisher ¶
type AdPublisher struct {
*dbschema.OfficialAdPublisher
}
func NewAdPublisher ¶
func NewAdPublisher(ctx echo.Context) *AdPublisher
func (*AdPublisher) Add ¶
func (f *AdPublisher) Add() (pk interface{}, err error)
func (*AdPublisher) Exists ¶
func (f *AdPublisher) Exists(ownerType string, ownerID uint64) (bool, error)
func (*AdPublisher) ExistsOther ¶
type AdSettings ¶
type AdSettings struct {
*dbschema.OfficialAdSettings
}
func NewAdSettings ¶
func NewAdSettings(ctx echo.Context) *AdSettings
func (*AdSettings) Add ¶
func (f *AdSettings) Add() (pk interface{}, err error)
func (*AdSettings) ExistsOther ¶
func (f *AdSettings) ExistsOther(name string, id uint64) (bool, error)
type CachedAdvert ¶
type CachedAdvert struct {
List PositionAdverts
RefreshedAt time.Time
}
func GetCachedAdvert ¶
func GetCachedAdvert(ctx echo.Context, idents ...string) (*CachedAdvert, error)
func (*CachedAdvert) GenHTML ¶
func (c *CachedAdvert) GenHTML() *CachedAdvert
type ContentRenderer ¶
type ItemAndPosition ¶
type ItemAndPosition struct {
*dbschema.OfficialAdItem
Rendered string
AdPosition *dbschema.OfficialAdPosition `db:"-,relation=id:position_id|gtZero"`
}
func (*ItemAndPosition) GetContent ¶
func (i *ItemAndPosition) GetContent() string
func (*ItemAndPosition) GetContype ¶
func (i *ItemAndPosition) GetContype() string
func (*ItemAndPosition) GetDescription ¶
func (i *ItemAndPosition) GetDescription() string
func (*ItemAndPosition) GetHeight ¶
func (i *ItemAndPosition) GetHeight() uint
func (*ItemAndPosition) GetTitle ¶
func (i *ItemAndPosition) GetTitle() string
func (*ItemAndPosition) GetURL ¶
func (i *ItemAndPosition) GetURL() string
func (*ItemAndPosition) GetWidth ¶
func (i *ItemAndPosition) GetWidth() uint
type ItemAndRendered ¶
type ItemAndRendered struct {
*dbschema.OfficialAdItem
Rendered string
}
type ItemResponse ¶
type ItemResponse struct {
Content string `json:"content" xml:"content"`
Contype string `json:"contype" xml:"contype"`
URL string `json:"url" xml:"url"`
Start uint `json:"start,omitempty" xml:"start,omitempty"`
End uint `json:"end,omitempty" xml:"end,omitempty"`
Width uint `json:"width,omitempty" xml:"width,omitempty"`
Height uint `json:"height,omitempty" xml:"height,omitempty"`
Rendered string `json:"rendered,omitempty" xml:"rendered,omitempty"`
Title string `json:"title" xml:"title"`
Description string `json:"description" xml:"description"`
}
func NewItemResponse ¶
func NewItemResponse(item *dbschema.OfficialAdItem, position *dbschema.OfficialAdPosition) *ItemResponse
func (*ItemResponse) GenHTML ¶
func (i *ItemResponse) GenHTML() *ItemResponse
func (*ItemResponse) GetContent ¶
func (i *ItemResponse) GetContent() string
func (*ItemResponse) GetContype ¶
func (i *ItemResponse) GetContype() string
func (*ItemResponse) GetDescription ¶
func (i *ItemResponse) GetDescription() string
func (*ItemResponse) GetHeight ¶
func (i *ItemResponse) GetHeight() uint
func (*ItemResponse) GetTitle ¶
func (i *ItemResponse) GetTitle() string
func (*ItemResponse) GetURL ¶
func (i *ItemResponse) GetURL() string
func (*ItemResponse) GetWidth ¶
func (i *ItemResponse) GetWidth() uint
func (*ItemResponse) HTML ¶
func (i *ItemResponse) HTML() template.HTML
type ItemsResponse ¶
type ItemsResponse []*ItemResponse
func (ItemsResponse) First ¶
func (i ItemsResponse) First() *ItemResponse
func (*ItemsResponse) GenHTML ¶
func (i *ItemsResponse) GenHTML() *ItemsResponse
func (ItemsResponse) Last ¶
func (i ItemsResponse) Last() *ItemResponse
func (*ItemsResponse) Place ¶
func (c *ItemsResponse) Place(_ string) *ItemsResponse
func (ItemsResponse) Rand ¶
func (i ItemsResponse) Rand() *ItemResponse
func (ItemsResponse) Shuffle ¶
func (i ItemsResponse) Shuffle() ItemsResponse
func (ItemsResponse) Size ¶
func (i ItemsResponse) Size() int
func (ItemsResponse) Valid ¶
func (i ItemsResponse) Valid() bool
type PositionAdverts ¶
type PositionAdverts map[string]ItemsResponse
func (*PositionAdverts) GenHTML ¶
func (c *PositionAdverts) GenHTML() *PositionAdverts
func (PositionAdverts) Place ¶
func (c PositionAdverts) Place(ident string) ItemsResponse
func (PositionAdverts) Valid ¶
func (c PositionAdverts) Valid() bool
type PositionWithRendered ¶
type PositionWithRendered struct {
*dbschema.OfficialAdPosition
Rendered string
}
func (*PositionWithRendered) GetContent ¶
func (i *PositionWithRendered) GetContent() string
func (*PositionWithRendered) GetContype ¶
func (i *PositionWithRendered) GetContype() string
func (*PositionWithRendered) GetDescription ¶
func (i *PositionWithRendered) GetDescription() string
func (*PositionWithRendered) GetHeight ¶
func (i *PositionWithRendered) GetHeight() uint
func (*PositionWithRendered) GetTitle ¶
func (i *PositionWithRendered) GetTitle() string
func (*PositionWithRendered) GetURL ¶
func (i *PositionWithRendered) GetURL() string
func (*PositionWithRendered) GetWidth ¶
func (i *PositionWithRendered) GetWidth() uint
Click to show internal directories.
Click to hide internal directories.