Help us shape the future of Go! Take the 2026 Go Developer Survey

ads

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ads holds the ads row (the ads table): an ad the public site shows while it is enabled and inside its schedule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ads

type Ads struct {
	Id          int64     `gorm:"primaryKey"`
	Title       string    `gorm:"type:varchar(255);default:'';not null;comment:Ads title"`
	Type        string    `gorm:"type:varchar(255);default:'';not null;comment:Ads type"`
	Content     string    `gorm:"type:text;comment:Ads content"`
	Description string    `gorm:"type:text;comment:Ads descriptor"`
	TargetURL   string    `gorm:"type:varchar(512);default:'';comment:Ads target url"`
	StartTime   time.Time `gorm:"type:datetime;comment:Ads start time"`
	EndTime     time.Time `gorm:"type:datetime;comment:Ads end time"`
	Status      int       `gorm:"type:TINYINT;default:0;comment:Ads status,0 disable,1 enable"`
	CreatedAt   time.Time `gorm:"<-:create;comment:Create Time"`
	UpdatedAt   time.Time `gorm:"comment:Update Time"`
}

func (Ads) TableName

func (Ads) TableName() string

type Filter

type Filter struct {
	Status *int
	Search string
	// ActiveAt keeps only ads scheduled to run at that instant. An unset
	// bound (NULL, or the Unix epoch the admin API stores for an omitted
	// time) leaves that side of the schedule open.
	ActiveAt *time.Time
}

Filter selects a page of the ads list.

Jump to

Keyboard shortcuts

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